Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Resolve cross references for new objects that has not been committed yet
[CDO] Resolve cross references for new objects that has not been committed yet [message #1016653] Thu, 07 March 2013 04:23 Go to next message
Jim Stanton is currently offline Jim Stanton
Messages: 2
Registered: March 2013
Junior Member
Hi,

Since a while I converted my application to use CDO 4.0 because of the amount of data it has to handle. It all works very well however there are some problems I haven't been able to solve yet. One of them I describe below:

I am trying to understand how I can replace the EMF ECrossReferenceAdapter with something more CDO conform for my huge model. The ECrossReferenceAdapter seems to eagerly adapt itself and cause the whole model to be loaded into memory. The application blocks for several minutes.

Now, for references persisted in the database already I can use the queryXRefs of the CDOView and get all cross references:
org.eclipse.emf.cdo.view.cdoView.queryXRefs(cdoObject, EReference...)
org.eclipse.emf.cdo.view.cdoView.queryXRefs(Set<cdoObject>, EReference...)
org.eclipse.emf.cdo.view.cdoView.queryXRefsAsync(Set<cdoObject>, EReference...)

The problem I have is that new references, that weren't committed yet, are not included in the returning list of CDOObjectReferences. Only what already was committed in the database. Now I am trying to find out if I am missing to add some adapter for that, or if it already exists a similar utility method as the queryXRefs for objects created in the session but not yet committed? Would retrieving deltas be relevant for that?

Cheers Jim
Re: [CDO] Resolve cross references for new objects that has not been committed yet [message #1016820 is a reply to message #1016653] Thu, 07 March 2013 14:44 Go to previous messageGo to next message
Eike Stepper is currently offline Eike Stepper
Messages: 5499
Registered: July 2009
Senior Member
Am 07.03.2013 18:01, schrieb Jim Stanton:
> Hi,
>
> Since a while I converted my application to use CDO 4.0 because of the amount of data it has to handle. It all works
> very well however there are some problems I haven't been able to solve yet. One of them I describe below:
>
> I am trying to understand how I can replace the EMF ECrossReferenceAdapter with something more CDO conform for my huge
> model. The ECrossReferenceAdapter seems to eagerly adapt itself and cause the whole model to be loaded into memory.
> The application blocks for several minutes.
> Now, for references persisted in the database already I can use the queryXRefs of the CDOView and get all cross
> references:
> org.eclipse.emf.cdo.view.cdoView.queryXRefs(cdoObject, EReference...)
> org.eclipse.emf.cdo.view.cdoView.queryXRefs(Set<cdoObject>, EReference...)
> org.eclipse.emf.cdo.view.cdoView.queryXRefsAsync(Set<cdoObject>, EReference...)
>
> The problem I have is that new references, that weren't committed yet, are not included in the returning list of
> CDOObjectReferences. Only what already was committed in the database. Now I am trying to find out if I am missing to
> add some adapter for that, or if it already exists a similar utility method as the queryXRefs for objects created in
> the session but not yet committed? Would retrieving deltas be relevant for that?
I think it would be reasonable that the queryXRefs() "merges" the remote result with possible local changes. Please
submit an enhancement request. If you want to provide a patch for this you may want to make use of these methods:

CDOTransaction.getNewObjects() and CDOObject.cdoRevision()
CDOTransaction.getDetachedObjects()
CDOTransaction.getDirtyObjects() or CDOTransaction.getRevisionDeltas()

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Re: [CDO] Resolve cross references for new objects that has not been committed yet [message #1016902 is a reply to message #1016820] Fri, 08 March 2013 02:53 Go to previous message
Jim Stanton is currently offline Jim Stanton
Messages: 2
Registered: March 2013
Junior Member
Hi Eike,

thank's for your promt reply. I submitted an enhancement request as you proposed:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=402714

I hope to be able to submit a patch later on.

Cheers Jim
Previous Topic:[CDO] Drag & Drop in CDO Sessions View fails
Next Topic:Explicitly show an attribute in a EMF Model
Goto Forum:
  


Current Time: Thu Aug 21 14:01:12 EDT 2014

Powered by FUDForum. Page generated in 0.06587 seconds