Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Multiple Roots
[CDO] Multiple Roots [message #426725] Mon, 19 January 2009 16:11 Go to next message
Oelerink is currently offline OelerinkFriend
Messages: 129
Registered: July 2009
Senior Member
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 16:32 Go to previous message
Simon Mc Duff is currently offline Simon Mc DuffFriend
Messages: 596
Registered: July 2009
Senior Member
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: Fri Apr 19 01:06:28 GMT 2024

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

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

Back to the top