[CDO] recovering from transient errors? [message #770221] |
Fri, 23 December 2011 17:15 |
Eclipse User |
|
|
|
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 |
|
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
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Powered by
FUDForum. Page generated in 0.02920 seconds