[CDO] Client side ID generation [message #1715502] |
Tue, 24 November 2015 07:45 |
Thorsten Schlathölter 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 |
|
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
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
Powered by
FUDForum. Page generated in 0.04867 seconds