[CDO] Can different idGenerationLocations be used on a same server ? [message #1222388] |
Fri, 20 December 2013 09:40 |
|
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 #1242244 is a reply to message #1231714] |
Sun, 09 February 2014 07:58 |
|
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
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Powered by
FUDForum. Page generated in 0.03235 seconds