| [CDO] CDOStaleReferencePolicy.PROXY vs bind method [message #989205] |
Wed, 05 December 2012 03:50  |
Paco Blanco Messages: 28 Registered: June 2012 |
Junior Member |
|
|
We set stale reference policy of an transaction to PROXY mode:
cdoTransaction.options().setStaleReferencePolicy(CDOStaleReferencePolicy.PROXY)
We have an existent (not stale) object in an audit view and want to bind this object to a transaction in PROXY mode. Unluckly, bind method always throws ObjectNotFound exception instead of a proxy object to check CDOUtil.isStaleObject(object).
In fact, this is an possible error to a big unimplement thing:
I have an object in audit view and I do a copy of it that I want to save in db. I bind this new copy object to transaction but at committing all eReference return an "object is from different view" exception. So I have to do a recursive bind of all eReference inner elements and replace them. When I find a stale reference object in the recursive bind, bind methods throws the exception refers in this topic.
[Updated on: Wed, 05 December 2012 03:52] Report message to a moderator
|
|
|
|
|
| Re: [CDO] CDOStaleReferencePolicy.PROXY vs bind method [message #989959 is a reply to message #989944] |
Mon, 10 December 2012 04:26  |
Eike Stepper Messages: 5148 Registered: July 2009 |
Senior Member |
|
|
Am 10.12.2012 08:49, schrieb Paco Blanco:
> bind = contextify yes, sorry
>
> So two questions:
> - is there some way to check if an object exists in a view (from specified timestamp or transaction at current time)?
CDOView.isObjectRegistered(id) tells you whether the object with that ID is currently loaded/cached in that view.
CDOView.getObject(...) throws an ObjectNotFoundException which you can catch to tell whether the object exists remotely.
> - is there some way to restore a deleted Object (to keep the same CDOId)?
AFAIK that's only possible in branching mode when you merge back a deleted object from a branch where it isn't deleted.
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Powered by
FUDForum. Page generated in 0.01611 seconds