Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Can different idGenerationLocations be used on a same server ?
[CDO] Can different idGenerationLocations be used on a same server ? [message #1222388] Fri, 20 December 2013 09:40 Go to next message
Alex Lagarde is currently offline Alex LagardeFriend
Messages: 193
Registered: May 2010
Senior Member

Hi everyone,

CDO allows to provide our own strategy for generating CDOIDs (see
http://wiki.eclipse.org/CDO/Server_Configuration_Reference#Property_idGenerationLocation
).

In case of a migration, it could be very interesting for us to apply the
following strategy:
- Use "STORE" generated CDOIDs
- When we want to migrate, we download the models in xmi files locally
and keep a traceability between CDOID and the corresponding xmiID for
each downloaded element
- We then perform the model migration locally
- We start a new repository with idGenerationLocation="CLIENT"
- We export the migrated models, using the traceability infos to set the
correct CDOID for each element
- We restart a new repository with idGenerationLocation="STORE"

Is this something that could work ? Would the CDO Server be able to work
with a "STORE" idGenerationLocation after this import ?

Best regards,
Alex
Re: [CDO] Can different idGenerationLocations be used on a same server ? [message #1222438 is a reply to message #1222388] Fri, 20 December 2013 12:15 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.12.2013 10:40, schrieb Alex Lagarde:
> Hi everyone,
>
> CDO allows to provide our own strategy for generating CDOIDs (see
> http://wiki.eclipse.org/CDO/Server_Configuration_Reference#Property_idGenerationLocation ).
>
> In case of a migration, it could be very interesting for us to apply the following strategy:
> - Use "STORE" generated CDOIDs
> - When we want to migrate, we download the models in xmi files locally and keep a traceability between CDOID and the
> corresponding xmiID for each downloaded element
> - We then perform the model migration locally
> - We start a new repository with idGenerationLocation="CLIENT"
> - We export the migrated models, using the traceability infos to set the correct CDOID for each element
> - We restart a new repository with idGenerationLocation="STORE"
>
> Is this something that could work ? Would the CDO Server be able to work with a "STORE" idGenerationLocation after
> this import ?
No, it's not possible. The ID generation location value has influence on how (with what data type) the DB columns for
IDs get created. After that point it will lead to failure if you change the original value.

Cheers
/Eike

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


Re: [CDO] Can different idGenerationLocations be used on a same server ? [message #1231714 is a reply to message #1222438] Wed, 15 January 2014 08:41 Go to previous messageGo to next message
Stéphane  Thibaudeau is currently offline Stéphane ThibaudeauFriend
Messages: 4
Registered: June 2012
Junior Member
Hi,

To achieve the same result, would it be possible to customize the ID generator on the server side so it can generate ID based on the traceability informations for migrated elements and fall back to a default generated ID for new elements ?

Regards,
Stéphane.
Re: [CDO] Can different idGenerationLocations be used on a same server ? [message #1242244 is a reply to message #1231714] Sun, 09 February 2014 07:58 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 15.01.2014 09:41, schrieb Stéphane Thibaudeau:
> Hi,
>
> To achieve the same result, would it be possible to customize the ID generator on the server side so it can generate
> ID based on the traceability informations for migrated elements and fall back to a default generated ID for new elements ?
On the server side the ID generation (handling, more generally) has a lot more responsibilities and is always
IStore-specific. The DBStore uses an instance of org.eclipse.emf.cdo.server.db.IIDHandler, typically LongIDHandler to
deal with IDs, meta IDs, external IDs and their column types in the database.

I've not heard of anybody trying it out but in theory you can play with it by changing how
org.eclipse.emf.cdo.server.internal.db.DBStore.doActivate() initializes the ID handler. Currently this is done:

if (idGenerationLocation == IDGenerationLocation.CLIENT)
{
idHandler = new UUIDHandler(this);
}
else
{
idHandler = new LongIDHandler(this);
}

If your scenario is reasonable and you can make it work in a prototype we can probably introduce an IDHandlerFactory so
that you don't have to fork the whole DBStore.

Cheers
/Eike

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


Previous Topic:[EMF] [CDO] ConcurrentModificationException when setting setTrackingModification(true)
Next Topic:[CDO] Ecore lazy-loading
Goto Forum:
  


Current Time: Sat Apr 20 03:14:51 GMT 2024

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

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

Back to the top