XMI:ID attributed to several objects ? [message #885197] |
Tue, 12 June 2012 15:36 |
Sebastien Gabel 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 |
Ed Merks Messages: 33217 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,
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Re: XMI:ID attributed to several objects ? [message #885811 is a reply to message #885266] |
Wed, 13 June 2012 16:34 |
Sebastien Gabel 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 |
Ed Merks Messages: 33217 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
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02808 seconds