Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » XMI:ID attributed to several objects ?
XMI:ID attributed to several objects ? [message #885197] Tue, 12 June 2012 15:36 Go to next message
Sebastien Gabel is currently offline Sebastien GabelFriend
Messages: 2
Registered: June 2012
Junior Member
Hi folks,

Although I'm using EMF since several years, I'm facing a weird problem that I don't manage to solve. In my XMI models produced by my RCP application, some xmi:ids are shared by several objects (generally two objects, not more). I thought these last ones were unique and universal....

Here, a short snippet to illustrate :

<types xsi:type="types:IClass" xmi:id="_hu6ml7SNEeGke8PT9bmQ3g" name="ISimEntityFactory" editable="true" reference="false" fullyQualifiedName="SA.Core.ISimEntityFactory">
   <members xmi:id="_hu6mJbSNEeGke8PT9bmQ3g" name="Severity" editable="true" reference="false" type="_hu6mNrSNEeGke8PT9bmQ3g"/>
   ....
</types
<types xsi:type="types:IClass" xmi:id="_hu6mJLSNEeGke8PT9bmQ3g" name="ISimMessage" editable="true" reference="false" fullyQualifiedName="SA.Support.FormalMessages.ISimMessage">
   <members xmi:id="_hu6mL7SNEeGke8PT9bmQ3g" name="IsNull" editable="true" reference="false" type="_hu6lhbSNEeGke8PT9bmQ3g"/>
   .....
</types>


In the above snippet, the xmi:id of the 'ISimEntityFactory' IClass is shared with the 'IsNull' member of another IClass.
I don't understand how and why ?

What technical reason(s) could cause this kind of troubles ?
Is there a XMI serialization option that could be responsible for this behavior (I use many of them) ?
Does anyone have already encountered xmi:id problems as presented above ?
For my developments, I had to use Eclipse 3.5.2 with EMF 2.5.0.

Any clue is welcome
Thanks in advance,

Sebastien

[Updated on: Tue, 12 June 2012 15:36]

Report message to a moderator

Re: XMI:ID attributed to several objects ? [message #885253 is a reply to message #885197] Tue, 12 June 2012 17:24 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30353
Registered: July 2009
Senior Member
Sébastien,

Comments below.

On 12/06/2012 5:36 PM, Sébastien Gabel wrote:
> Hi folks,
>
> Although I'm using EMF since several years, I'm facing a weird problem
> that I don't manage to solve. In my XMI models produced by my RCP
> application, some xmi:ids are shared by several objects (generally two
> objects, not more). I thought these last ones were unique and
> universal....
>
> Here, a short snippet to illustrate :
>
> <types xsi:type="types:IClass" xmi:id="_hu6ml7SNEeGke8PT9bmQ3g"
> name="ISimEntityFactory" editable="true" reference="false"
> fullyQualifiedName="SA.Core.ISimEntityFactory">
> <members xmi:id="_hu6mJbSNEeGke8PT9bmQ3g" name="Severity"
> editable="true" reference="false" type="_hu6mNrSNEeGke8PT9bmQ3g"/>
> ....
> </types
> <types xsi:type="types:IClass" xmi:id="_hu6mJLSNEeGke8PT9bmQ3g"
> name="ISimMessage" editable="true" reference="false"
> fullyQualifiedName="SA.Support.FormalMessages.ISimMessage">
> <members xmi:id="_hu6mL7SNEeGke8PT9bmQ3g" name="IsNull"
> editable="true" reference="false" type="_hu6lhbSNEeGke8PT9bmQ3g"/>
> .....
> </types>
>
> In the above snippet, the xmi:id of the 'ISimEntityFactory' IClass is
> shared with the 'IsNull' member of another IClass.
> I don't understand how and why ?
When XMI IDs are generated using EcoreUtil.generateUUID, it should not
be possible for this method to return the same value more than once.
>
> What technical reason(s) could cause this kind of troubles ?
It's hard to imagine how it's even possible.
> Is there a XMI serialization option that could be responsible for this
> behavior (I use many of them) ?
No.
> Does anyone have already encountered xmi:id problems as presented above ?
I've never head of this.
> For my developments, I had to use Eclipse 3.5.2 with EMF 2.5.0.
Is this problem commonly reproducible? Are these new objects you're
creating? XMLResourceImpl.attachedHelper should be using generateUUID
to produce unique new IDs for newly attached objects.
>
> Any clue is welcome Thanks in advance,
>
Re: XMI:ID attributed to several objects ? [message #885266 is a reply to message #885253] Tue, 12 June 2012 17:49 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6438
Registered: July 2009
Senior Member
Hi

>> What technical reason(s) could cause this kind of troubles ?
> It's hard to imagine how it's even possible.
I've managed to achieve duplicates using EcoreUtil.copy, but they were
true copies, so the same type.

I would suspect some form of user copy, or cloning of a prototype, or
unresolved use of a proxy/placeholder.

Almost certainly a user bug.

Put a println in generateUuid to conform that one UUID is being reused
rather than multiply generated.

You could instrument setID to detect the point at which a duplicate is
created.

Regards

Ed Willink
Re: XMI:ID attributed to several objects ? [message #885811 is a reply to message #885266] Wed, 13 June 2012 16:34 Go to previous messageGo to next message
Sebastien Gabel is currently offline Sebastien GabelFriend
Messages: 2
Registered: June 2012
Junior Member
Hi,

First, thanks a lot for these replies and confirmations.

I have finally found the origin of all my questions. I have to say that is pretty stupid.

If you look carefully at the snippet I posted yesterday, you will see that the XMI:IDs are not the same but almost the same.
On the one hand, we have "_hu6ml7SNEeGke8PT9bmQ3g" for the ISimEntityFactory element. On the other hand we have "_hu6mL7SNEeGke8PT9bmQ3g" for the IsNull element. Only the sixth character differs : upper case vs lower case.

I am reassured now ! I didn't give you all elements to understand what I'm currently doing but it works better now : I was facing a sort of case-insensitive problem.

Regards,

Sébastien

[Updated on: Wed, 13 June 2012 16:42]

Report message to a moderator

Re: XMI:ID attributed to several objects ? [message #885892 is a reply to message #885811] Wed, 13 June 2012 20:13 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 30353
Registered: July 2009
Senior Member
Sébastien,

It's ironic that something that's universally unique (for machines) is
like an eye chart of indistinguishability for humans.


On 13/06/2012 6:34 PM, Sébastien Gabel wrote:
> Hi,
>
> First, thanks a lot for these replies and confirmations.
>
> I have finally found the origin of all my questions. I have to say
> that is pretty stupid.
>
> If you look carefully at the snippet I posted yesterday, you will see
> that the XMI:IDs are not the same (as affirmed) but almost the same.
> On the one hand, we have "_hu6ml7SNEeGke8PT9bmQ3g" for the
> ISimEntityFactory element. On the other hand we have
> "_hu6mL7SNEeGke8PT9bmQ3g" for the IsNull element. Only the sixth
> character differs : upper case vs lower case.
>
> I am reassured now ! I didn't give you all elements to understand what
> I'm currently doing but it works better now : I was facing a sort of
> case-insensitive problem.
> Regards,
> Sébastien
Previous Topic:Override eSet()... Should I?
Next Topic:[NET4J] SSL acceptor support
Goto Forum:
  


Current Time: Tue Aug 20 23:34:32 GMT 2019

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

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

Back to the top