Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] recovering from transient errors?
[CDO] recovering from transient errors? [message #770221] Fri, 23 December 2011 17:15 Go to next message
Eclipse UserFriend
How does CDO recover from transient errors?
e.g. the CDO server/database rebooted.
Let's assume I get a CommitException in a transaction.commit() call, because the CDO server is temporarily unavailable.
I wait until the server is available again. What should i do?
- just call transaction.commit() again?
- create a new session, and somehow replay the transaction in it?
Re: [CDO] recovering from transient errors? [message #772256 is a reply to message #770221] Thu, 29 December 2011 11:04 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6690
Registered: July 2009
Senior Member
Am 23.12.2011 18:15, schrieb mag:
> How does CDO recover from transient errors?
> e.g. the CDO server/database rebooted.
Usually that would deactivate all open sessions to this repository and you can not call any methods on their
views/transactions. So the first preparation to "survive" server losses is to use a subclass of
org.eclipse.emf.cdo.internal.net4j.RecoveringCDOSessionImpl, either an own one or one of the shipped implementations
that you can instantiate with:

CDONet4jUtil.createReconnectingSessionConfiguration(String, String, IManagedContainer)
CDONet4jUtil.createFailoverSessionConfiguration(String, String)
CDONet4jUtil.createFailoverSessionConfiguration(String, String, IManagedContainer)

> Let's assume I get a CommitException in a transaction.commit() call, because the CDO server is temporarily unavailable.
> I wait until the server is available again. What should i do?
> - just call transaction.commit() again?
Yes, if your session has survived (see above).

> - create a new session, and somehow replay the transaction in it?
Would also work. These methods can help:

CDOTransaction.exportChanges(OutputStream)
CDOTransaction.importChanges(InputStream, boolean)

And there's a CDOPushTransaction that can also read the previous exports.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Previous Topic:[EMF Compare]Trouble with the ExampleLauncher
Next Topic:Modeling data using external APIs
Goto Forum:
  


Current Time: Wed Sep 25 10:40:20 GMT 2024

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

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

Back to the top