Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Client side ID generation(java.lang.IllegalStateException: Suffix is too long: )
[CDO] Client side ID generation [message #1715502] Tue, 24 November 2015 07:45 Go to next message
Thorsten Schlathölter is currently offline Thorsten SchlathölterFriend
Messages: 312
Registered: February 2012
Location: Düsseldorf
Senior Member
Hi,
I am trying to use CLIENT side ID generation by setting

<property name="idGenerationLocation" value="CLIENT"/> <!-- Possible values: STORE | CLIENT -->


As a result the UUIDHandler is used to create ids for the objects. Now when I try to pre-register packages, ids are generated for the elements of these packages. As a result I get an exception:

java.lang.IllegalStateException: Suffix is too long: _FEhttp://www.eclipse.org/uml2/5.0.0/UML#//ActivityNode/inInterruptibleRegion
	at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.getName(AbstractMappingStrategy.java:445)
	at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.getTableName(AbstractMappingStrategy.java:399)
	at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.BranchingListTableMappingWithRanges.initTable(BranchingListTableMappingWithRanges.java:131)
	at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.BranchingListTableMappingWithRanges.<init>(BranchingListTableMappingWithRanges.java:125)
	at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalBranchingMappingStrategyWithRanges.doCreateListMapping(HorizontalBranchingMappingStrategyWithRanges.java:77)


The relevant code

org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.getName(AbstractMappingStrategy.java:445)


that causes this exception states:

 if (name.length() > maxLength || forceNamesWithID)
    {
      suffix = NAME_SEPARATOR + suffix.replace('-', 'S');
      int length = Math.min(name.length(), maxLength - suffix.length());
      if (length < 0)
      {
        // Most likely CDOIDs are client side-assigned, i.e., meta IDs are extrefs. See getUniqueID()
        throw new IllegalStateException("Suffix is too long: " + suffix);
      }

      name = name.substring(0, length) + suffix;
    }


Which is true. But is there a workaround? The getUniquieId() method uses the MetaDataManger which itself uses the ID-Handler. The creation of the ID-Handler is hardcoded into DBStore. So it can not easily be replaced.

Regards,
Thorsten

[Updated on: Tue, 24 November 2015 08:51]

Report message to a moderator

Re: [CDO] Client side ID generation [message #1715524 is a reply to message #1715502] Tue, 24 November 2015 09:15 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Thorsten,

I think the AbstractMappingStrategy.getUniqueID(ENamedElement) method was not written with client side assigned IDs. The
suffix should clearly not become arbitrarily long. Please submit a bugzilla. I have no conrete idea, yet, how to fix
this. I'll need to debug through the complicated naming strategies to fully understand the problem and our options, but
I won't have time this week.

Maybe you can play with the "maxFieldNameLength" property in the cdo-server.xml and see if you can work around the
problem. There are also some other properties that impact the computed table and field names:
http://download.eclipse.org/modeling/emf/cdo/drops/I20151120-0411/help/org.eclipse.emf.cdo.doc/html/operators/Doc01_ConfiguringRepositories.html#Element_mappingStrategy

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



Am 24.11.2015 um 08:45 schrieb Thorsten Schlathölter:
> Hi,
> I am trying to use CLIENT side ID generation by setting
>
>
> <property name="idGenerationLocation" value="CLIENT"/> <!-- Possible values: STORE | CLIENT -->
>
>
> As a result the UUIDHandler is used to create ids for the objects. Now when I try to pre-register packages, ids are
> generated for the elements of these packages. As a result I get an exception:
>
>
> java.lang.IllegalStateException: Suffix is too long:
> _FEhttp://www.eclipse.org/uml2/5.0.0/UML#//ActivityNode/inInterruptibleRegion
> at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.getName(AbstractMappingStrategy.java:445)
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.getTableName(AbstractMappingStrategy.java:399)
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.BranchingListTableMappingWithRanges.initTable(BranchingListTableMappingWithRanges.java:131)
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.BranchingListTableMappingWithRanges.<init>(BranchingListTableMappingWithRanges.java:125)
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalBranchingMappingStrategyWithRanges.doCreateListMapping(HorizontalBranchingMappingStrategyWithRanges.java:77)
>
>
> The relevant code
>
>
> org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.getName(AbstractMappingStrategy.java:445)
>
>
> that causes this exception states:
>
>
> if (name.length() > maxLength || forceNamesWithID)
> {
> suffix = NAME_SEPARATOR + suffix.replace('-', 'S');
> int length = Math.min(name.length(), maxLength - suffix.length());
> if (length < 0)
> {
> // Most likely CDOIDs are client side-assigned, i.e., meta IDs are extrefs. See getUniqueID()
> throw new IllegalStateException("Suffix is too long: " + suffix);
> }
>
> name = name.substring(0, length) + suffix;
> }
>
>
> Which is true. But is there a workaround? The getUniquieId() method uses the MetaDataManger which itself uses the
> ID-Handler. The creation of the ID-Handler is hardcoded into DBStore. So it can not easily be replaced.
> Regards,
> Thorsten


Re: [CDO] Client side ID generation [message #1758308 is a reply to message #1715524] Mon, 27 March 2017 14:24 Go to previous message
Gergo Olah is currently offline Gergo OlahFriend
Messages: 1
Registered: July 2009
Junior Member
Hi Eike,

I have same problem, but I'am using PostgreSQLAdapter which has MaxTableNameLength limitation (63) in CDO.

I have to use CLIENT side id generation, because i would like to use Repository synchronization ( and as i know it is a requirement for this).

Do you know any workaround? Or any bug is submitted about this issue?

Regards,
Gergo
Previous Topic:Quickest way to change getter names that are generated
Next Topic:transformation to "Requiements diagram"
Goto Forum:
  


Current Time: Thu Mar 28 12:18:13 GMT 2024

Powered by FUDForum. Page generated in 0.04867 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top