Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Consistency between XMIID and CDOId
[CDO] Consistency between XMIID and CDOId [message #1440334] Wed, 08 October 2014 08:21 Go to next message
Julien Siega is currently offline Julien SiegaFriend
Messages: 8
Registered: September 2014
Junior Member
Hi everyone,

i'm using CDO and the function to import and export in XMI.

I need to hold the consistency between XMIId and CDOid. For example when i export my model from CDO to XMI i got XMIId for each Eobject. If i export again all XMIID are different for all EObjects.

it's the same for the import.

There is any way to keep the consistency between two exports, and imports ?

Thanks
Julien
Re: [CDO] Consistency between XMIID and CDOId [message #1440370 is a reply to message #1440334] Wed, 08 October 2014 09:24 Go to previous messageGo to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 295
Registered: March 2012
Senior Member
On 08/10/2014 10:21, Julien Siega wrote:
> Hi everyone,
>
> i'm using CDO and the function to import and export in XMI.
>
> I need to hold the consistency between XMIId and CDOid. For example when
> i export my model from CDO to XMI i got XMIId for each Eobject. If i
> export again all XMIID are different for all EObjects.
>
> it's the same for the import.
>
> There is any way to keep the consistency between two exports, and imports ?
>
> Thanks
> Julien

I know people who "solved" this by storing the extrinsic IDs in a
separate model in the CDO Repo on import, and then reusing them when
Exporting back to XML.

I think that if you find you have to conserve the IDs, you shouldn't use
them at all but rely on intrinsic model IDs.

Felix
Re: [CDO] Consistency between XMIID and CDOId [message #1440464 is a reply to message #1440370] Wed, 08 October 2014 11:55 Go to previous messageGo to next message
Julien Siega is currently offline Julien SiegaFriend
Messages: 8
Registered: September 2014
Junior Member
Felix Dorner wrote on Wed, 08 October 2014 09:24
On 08/10/2014 10:21, Julien Siega wrote:
> Hi everyone,
>
> i'm using CDO and the function to import and export in XMI.
>
> I need to hold the consistency between XMIId and CDOid. For example when
> i export my model from CDO to XMI i got XMIId for each Eobject. If i
> export again all XMIID are different for all EObjects.
>
> it's the same for the import.
>
> There is any way to keep the consistency between two exports, and imports ?
>
> Thanks
> Julien

I know people who "solved" this by storing the extrinsic IDs in a
separate model in the CDO Repo on import, and then reusing them when
Exporting back to XML.

I think that if you find you have to conserve the IDs, you shouldn't use
them at all but rely on intrinsic model IDs.

Felix

Thanks for the tips, Is it a correspondence table between XMIId and CDOid ?

Is it possible to override the generation of CDOId with my own id ? I have the idea to try to use XMIId inside CDO.
Re: [CDO] Consistency between XMIID and CDOId [message #1440507 is a reply to message #1440464] Wed, 08 October 2014 12:57 Go to previous messageGo to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 295
Registered: March 2012
Senior Member
On 08/10/2014 13:55, Julien Siega wrote:
> Felix Dorner wrote on Wed, 08 October 2014 09:24
>> On 08/10/2014 10:21, Julien Siega wrote:
>> > Hi everyone,
>> >
>> > i'm using CDO and the function to import and export in XMI.
>> >
>> > I need to hold the consistency between XMIId and CDOid. For example
>> when
>> > i export my model from CDO to XMI i got XMIId for each Eobject. If i
>> > export again all XMIID are different for all EObjects.
>> >
>> > it's the same for the import.
>> >
>> > There is any way to keep the consistency between two exports, and
>> imports ?
>> >
>> > Thanks
>> > Julien
>>
>> I know people who "solved" this by storing the extrinsic IDs in a
>> separate model in the CDO Repo on import, and then reusing them when
>> Exporting back to XML.
>>
>> I think that if you find you have to conserve the IDs, you shouldn't
>> use them at all but rely on intrinsic model IDs.
>>
>> Felix
>
> Thanks for the tips, Is it a correspondence table between XMIId and
> CDOid ?

I don't remember exactly, I think they mapped XMI Id to the Object itself.

> Is it possible to override the generation of CDOId with my own id ? I
> have the idea to try to use XMIId inside CDO.

That's what I always wondered, but I don't know how CDOIds work. It
didn't seem feasible for some reason.
Re: [CDO] Consistency between XMIID and CDOId [message #1440625 is a reply to message #1440464] Wed, 08 October 2014 16:13 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6441
Registered: July 2009
Senior Member
Am 08.10.2014 um 13:55 schrieb Julien Siega:
> Felix Dorner wrote on Wed, 08 October 2014 09:24
>> On 08/10/2014 10:21, Julien Siega wrote:
>> > Hi everyone,
>> >
>> > i'm using CDO and the function to import and export in XMI.
>> >
>> > I need to hold the consistency between XMIId and CDOid. For example when
>> > i export my model from CDO to XMI i got XMIId for each Eobject. If i
>> > export again all XMIID are different for all EObjects.
>> >
>> > it's the same for the import.
>> >
>> > There is any way to keep the consistency between two exports, and imports ?
>> >
>> > Thanks
>> > Julien
>>
>> I know people who "solved" this by storing the extrinsic IDs in a separate model in the CDO Repo on import, and then
>> reusing them when Exporting back to XML.
>>
>> I think that if you find you have to conserve the IDs, you shouldn't use them at all but rely on intrinsic model IDs.
>>
>> Felix
>
> Thanks for the tips, Is it a correspondence table between XMIId and CDOid ?
>
> Is it possible to override the generation of CDOId with my own id ? I have the idea to try to use XMIId inside CDO.
You can configure the server (before first start!) to let the clients generate UUIDs instead of the deault
server-generated long IDs:

In your cdo-server.xml set:

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

Then cdoID() will return a client-assigned UUID, which will also be stored in the cdo_id columns in the DB.

With CLIENT-assigned IDs you can plug your own CDOIDGenerator into the CDOSession:

org.eclipse.emf.cdo.session.CDOSessionConfiguration.setIDGenerator(CDOIDGenerator)

We could also enhance the CDOTransfer framework (assuming that's what you're using to export/import) to save target
XMLResources with xmi:id=CDOID.

Cheers
/Eike

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


Re: [CDO] Consistency between XMIID and CDOId [message #1441231 is a reply to message #1440625] Thu, 09 October 2014 12:30 Go to previous messageGo to next message
Julien Siega is currently offline Julien SiegaFriend
Messages: 8
Registered: September 2014
Junior Member
Thanks Eike,

> We could also enhance the CDOTransfer framework (assuming that's what you're using to export/import) to save target
> XMLResources with xmi:id=CDOID.

I will try to do it inside the CDO transfert framework, do you have any entry point ? (it's not easy to find tutorial on CDOTransfert Smile )
Re: [CDO] Consistency between XMIID and CDOId [message #1441271 is a reply to message #1441231] Thu, 09 October 2014 13:36 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6441
Registered: July 2009
Senior Member
Am 09.10.2014 um 14:30 schrieb Julien Siega:
> Thanks Eike,
>
>> We could also enhance the CDOTransfer framework (assuming that's what you're using to export/import) to save target
>> XMLResources with xmi:id=CDOID.
>
> I will try to do it inside the CDO transfert framework, do you have any entry point ? (it's not easy to find tutorial
> on CDOTransfert :) )
I would try to do it in CDOTransfer.ModelTransferContext.perform() after the copier.copyAll(). Note that you don't have
access to CDO (IDs) on this generic level. You'll have to add some method to CDOTransferSystem so that CDOTransferSystem
can provide the needed IDs. If you make all that nice and reusable I'd be happy to consider it as a contribution to CDO.

Cheers
/Eike

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


Re: [CDO] Consistency between XMIID and CDOId [message #1441885 is a reply to message #1441271] Fri, 10 October 2014 10:06 Go to previous message
Julien Siega is currently offline Julien SiegaFriend
Messages: 8
Registered: September 2014
Junior Member
Ok.

And i don't know if i found a bug but when i user the idGenerationLocation on client with the option PROP_FORCE_NAMES_WITH_ID to true on mapping.

I got an SQL exception during the startup of my server. When i debug, it try to create a table with the name :

CDOBINARYRESOURCE_CEHTTP://WWW.ECLIPSE.ORG/EMF/CDO/ERESOURCE/4.0.0#//CDOBINARYRESOURCE

instead of CDOBINARYRESOURCE_CLNumber

i got no problem if i use "STORE" or if i comment PROP_FORCE_NAMES_WITH_ID properties.

Julien

[Updated on: Fri, 10 October 2014 10:14]

Report message to a moderator

Previous Topic:Re: EMF : Code generation from ecore and genmodel
Next Topic:Setting xsiSchemaLocation
Goto Forum:
  


Current Time: Sun Aug 18 13:49:17 GMT 2019

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

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

Back to the top