|
|
|
| Re: [CDO] ObjectNotFoundExceptions and StaleReferencePolicies : best practices [message #831508 is a reply to message #702298] |
Wed, 28 March 2012 21:23   |
Scott Dybiec Messages: 67 Registered: July 2009 |
Member |
|
|
Alex,
I'm encountering this same issue and have been reading this forum and
the newsgroup for solutions.
In this post
http://www.eclipse.org/forums/index.php/mv/msg/197340/629963/
you say: "Following Eike Stepper's idea, I use an other Session, defined
with the same connector, for getting all CDOSessionInvalidationEvent and
refresh properly the changed elements."
Which you also describe here:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=329777
Was there ever any sample code or test cases posted of how you
implemented this two session solution for this problem?
$cott
On 7/26/2011 3:37 AM, Alex Lagarde wrote:
> Hi everyone !
>
> I'm trying to determine the best solution for an issue I've faced while
> using CDO :
>
> in a part of my code that is not CDO-dependant, I've got listeners that
> access model elements in order to do their jobs.
>
> But if a CDO element is being deleted by a remote user and one of my
> listeners is running, when calling deletedElement.eResource() I
> get an ObjectNotFoundException (which is totally normal : my element has
> just been deleted by some remote user).
>
> I cannot do much : once the element is deleted, I unregister my
> listener, but I cannot do anything if it is running.
>
> I've took a look at CDOStaleReferencePolicies, which seem to do exactly
> what I want : by providing my own StaleReferencePolicy, I can react to
> stale references by returning default values (e.g. an empty list if
> trying to access my deleted element's adapters), and avoid throwing
> ObjectNotFoundExceptions.
>
> But I'm not sure that is a clean solution : do you think providing such
> a custom StalePolicy can cause other issues ? I don't think I have much
> choice here...
>
> Thanks a lot !
> Alex
>
|
|
|
|
|
| Re: [CDO] ObjectNotFoundExceptions and StaleReferencePolicies : best practices [message #836480 is a reply to message #702298] |
Wed, 04 April 2012 10:29  |
Eike Stepper Messages: 5151 Registered: July 2009 |
Senior Member |
|
|
Guys,
Please note that I recently (CDO 4.1!) applied some smaller fixes that can have a big positive impact:
374962: Make CDOStaleReferencePolicy.PROXY robust for eAdapters() calls
https://bugs.eclipse.org/bugs/show_bug.cgi?id=374962
374965: Make detachment notifications configurable
https://bugs.eclipse.org/bugs/show_bug.cgi?id=374965
375033: Remote notifications must be ignored in CDOPostEventTransactionHandler
https://bugs.eclipse.org/bugs/show_bug.cgi?id=375033
375034: Consolidate server-side exceptions for commit conflicts
https://bugs.eclipse.org/bugs/show_bug.cgi?id=375034
376067: CDOFeatureDelta.UNKNOWN_VALUE is not a Notifier
https://bugs.eclipse.org/bugs/show_bug.cgi?id=376067
Give next Friday's I-build a try. I'm also starting to backport these fixes to 4.0 now...
You should play with CDO's InvalidationPolicies and StaleReferencePolicies, e.g.,
CDOView.Options options = view.options();
options.setStaleReferencePolicy(CDOStaleReferencePolicy.PROXY);
options.setInvalidationPolicy(CDOInvalidationPolicy.RELAXED);
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Am 26.07.2011 09:37, schrieb Alex Lagarde:
> Hi everyone !
>
> I'm trying to determine the best solution for an issue I've faced while using CDO :
>
> in a part of my code that is not CDO-dependant, I've got listeners that access model elements in order to do their jobs.
>
> But if a CDO element is being deleted by a remote user and one of my listeners is running, when calling
> deletedElement.eResource() I
> get an ObjectNotFoundException (which is totally normal : my element has just been deleted by some remote user).
>
> I cannot do much : once the element is deleted, I unregister my listener, but I cannot do anything if it is running.
>
> I've took a look at CDOStaleReferencePolicies, which seem to do exactly what I want : by providing my own
> StaleReferencePolicy, I can react to stale references by returning default values (e.g. an empty list if trying to
> access my deleted element's adapters), and avoid throwing ObjectNotFoundExceptions.
>
> But I'm not sure that is a clean solution : do you think providing such a custom StalePolicy can cause other issues ?
> I don't think I have much choice here...
>
> Thanks a lot !
> Alex
>
|
|
|
Powered by
FUDForum. Page generated in 0.02832 seconds