[CDO] Duplicate ID problem – Can a CDO model have multiple non-containment references to an external [message #423922] |
Thu, 09 October 2008 22:14 |
Stephen McCants Messages: 92 Registered: July 2009 |
Member |
|
|
Hello,
Bryan Hunt and I just moved to a version of CDO from Head about two days ago and that resolved a
great many of our problems, including the two previously posted SQLExceptions. (Thank you, Eike,
for the recommendation.)
Our model is a tree structure and the leaf nodes have a non-containment reference to objects in
another CDO model. This is working well under the new code, except when I try to have two leaf
nodes point to the same object in the other CDO model. In that case, I get a “Duplicate ID” error
message (exception included below). I looked at the CDO source code, but didn't see any obvious way
around this limitation. Is there a way to allow a CDO model to support duplicate non-containment
references to another CDO model? If not, should there be?
Here is the exception:
java.lang.IllegalStateException: Duplicate ID: CDOResource@OID10
at org.eclipse.emf.internal.cdo.CDOViewImpl.registerObject(CDOV iewImpl.java:738)
at org.eclipse.emf.internal.cdo.CDOViewImpl.registerProxyResour ce(CDOViewImpl.java:717)
at
org.eclipse.emf.cdo.eresource.impl.CDOResourceFactoryImpl.cr eateResource(CDOResourceFactoryImpl.java:70)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.createRe source(ResourceSetImpl.java:425)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandCr eateResource(ResourceSetImpl.java:239)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:391)
at org.eclipse.emf.internal.cdo.CDOViewImpl.getResource(CDOView Impl.java:340)
at org.eclipse.emf.internal.cdo.CDOViewImpl.getResource(CDOView Impl.java:330)
Thanks in advance for your help!
Sincerely,
Stephen McCants
|
|
|
Re: [CDO] Duplicate ID problem – Can a CDO model have multiple non-containment references to an exte [message #423925 is a reply to message #423922] |
Fri, 10 October 2008 01:50 |
Simon Mc Duff Messages: 596 Registered: July 2009 |
Senior Member |
|
|
Hi Stephen,
I think your problem is related to the following bugs
248915: Resources fetched using CDOViewImpl.getResource(CDOID) not added to
ResourceSet
https://bugs.eclipse.org/bugs/show_bug.cgi?id=248915
I know in this case we do not add the resource in the resourceset.
but...
If the object was loaded in CDOView previously without being added to the
resourceset... and we try to load it from the resourceset afterwards.. we
will have the error you just had.
We are currently working to fix that problem.
Don't worry, CDO support non-containment references to another CDO-model.
The problem is how objects gets loaded in memory.
If you load the resource at the beginning (before loading others objects...
it should work). But I know it is not a solution.
Simon
"Stephen McCants" <stephenmccants@yahoo.com> wrote in message
news:gclvog$rir$1@build.eclipse.org...
> Hello,
>
> Bryan Hunt and I just moved to a version of CDO from Head about two days
> ago and that resolved a great many of our problems, including the two
> previously posted SQLExceptions. (Thank you, Eike, for the
> recommendation.)
>
> Our model is a tree structure and the leaf nodes have a non-containment
> reference to objects in another CDO model. This is working well under the
> new code, except when I try to have two leaf nodes point to the same
> object in the other CDO model. In that case, I get a “Duplicate ID” error
> message (exception included below). I looked at the CDO source code, but
> didn't see any obvious way around this limitation. Is there a way to
> allow a CDO model to support duplicate non-containment references to
> another CDO model? If not, should there be?
>
> Here is the exception:
>
> java.lang.IllegalStateException: Duplicate ID: CDOResource@OID10
> at
> org.eclipse.emf.internal.cdo.CDOViewImpl.registerObject(CDOV iewImpl.java:738)
> at
> org.eclipse.emf.internal.cdo.CDOViewImpl.registerProxyResour ce(CDOViewImpl.java:717)
> at
> org.eclipse.emf.cdo.eresource.impl.CDOResourceFactoryImpl.cr eateResource(CDOResourceFactoryImpl.java:70)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.createRe source(ResourceSetImpl.java:425)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandCr eateResource(ResourceSetImpl.java:239)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:391)
> at
> org.eclipse.emf.internal.cdo.CDOViewImpl.getResource(CDOView Impl.java:340)
> at
> org.eclipse.emf.internal.cdo.CDOViewImpl.getResource(CDOView Impl.java:330)
>
> Thanks in advance for your help!
>
> Sincerely,
> Stephen McCants
|
|
|
|
Powered by
FUDForum. Page generated in 0.02563 seconds