[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.emf] Re: [CDO] Duplicate ID problem – Can a CDO model have multiple non-containment references to an external CDO model?

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@xxxxxxxxx> wrote in message news:gclvog$rir$1@xxxxxxxxxxxxxxxxxxxx
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(CDOViewImpl.java:738)
at org.eclipse.emf.internal.cdo.CDOViewImpl.registerProxyResource(CDOViewImpl.java:717)
at org.eclipse.emf.cdo.eresource.impl.CDOResourceFactoryImpl.createResource(CDOResourceFactoryImpl.java:70)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.createResource(ResourceSetImpl.java:425)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandCreateResource(ResourceSetImpl.java:239)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:391)
at org.eclipse.emf.internal.cdo.CDOViewImpl.getResource(CDOViewImpl.java:340)
at org.eclipse.emf.internal.cdo.CDOViewImpl.getResource(CDOViewImpl.java:330)


Thanks in advance for your help!

Sincerely,
Stephen McCants