Skip to main content



      Home
Home » Modeling » EMF » [CDO] Multiple Roots
[CDO] Multiple Roots [message #426725] Mon, 19 January 2009 11:11 Go to next message
Eclipse UserFriend
Hello,

i want to add some elements to a cdoresource. So i take a CDOResource
CDOResource resource = transaction.getOrCreateResource(res+i) and add
some elements resource.getContents().add(obj). These Objects are created
by the normal xYzFactory . If i commit now, i get an exception that some
objects has no resource. Is it not possible to add generated Objects
to an CDOResource? What resource do they need so i didn't get this
exception?

Greetings
Jörg
Re: [CDO] Multiple Roots [message #426730 is a reply to message #426725] Mon, 19 January 2009 11:32 Go to previous message
Eclipse UserFriend
You have probably a dangling reference problem.

For each object you add (in your example "obj") You need to check
EReference that containment = false. If this is the case you need to
make sure these objects belong to a resource.

Simon

Jörg wrote:
> Hello,
>
> i want to add some elements to a cdoresource. So i take a CDOResource
> CDOResource resource = transaction.getOrCreateResource(res+i) and add
> some elements resource.getContents().add(obj). These Objects are created
> by the normal xYzFactory . If i commit now, i get an exception that some
> objects has no resource. Is it not possible to add generated Objects to
> an CDOResource? What resource do they need so i didn't get this exception?
>
> Greetings
> Jörg
Previous Topic:Databinding and ISelectionChanged
Next Topic:refactoring imports in a XSD
Goto Forum:
  


Current Time: Sun Jul 06 23:48:50 EDT 2025

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

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

Back to the top