|
|
Re: [CDO] CDOTransaction or CDOXATransaction participating in XA transaction [message #1034367 is a reply to message #1032222] |
Fri, 05 April 2013 10:59 |
|
Am 02.04.2013 21:23, schrieb Pavel Vlasov:
> I looked at the source of CDOXATransactionImpl and it appears that its Phase 1 & 2 map to XAResource.prepare() and
> Phase 3 maps to XAResource.commit(). Therefore, IMO, the easiest way to JTA enable CDO is probably to take
> CDOXATransactionImpl source, split its commit() method into prepare() (phase 1 & 2) and commit() (phase 3) and then
> wrap into/facade with XAResource. An advice from gurus whether this approach is OK or whether there is a better way is
> highly appreciated!
That's exactly what I was going to suggest ;-)
I've just committed the following changes to org.eclipse.emf.internal.cdo.transaction.CDOXATransactionImpl:
public CDOCommitInfo commit(IProgressMonitor progressMonitor) throws CommitException
{
commitPrepare(progressMonitor);
int phase = 0;
try
{
// We need to complete 3 phases
while (phase <= 2)
{
commitPhase(progressMonitor);
++phase;
}
}
catch (Exception ex)
{
commitException(progressMonitor, phase, ex);
}
finally
{
commitFinally(progressMonitor);
}
return null;
}
The following new methods could be used by JTA:
CDOXATransactionImpl.commitPrepare(IProgressMonitor)
CDOXATransactionImpl.commitPhase(IProgressMonitor)
CDOXATransactionImpl.commitException(IProgressMonitor, int, Exception)
CDOXATransactionImpl.commitFinally(IProgressMonitor)
It would be cool if you contribute your JTA wrapper. Please open a bugzilla and attach a patch. If the patch can be
accepted I'll expose the new CDOXATransactionImpl methods via InternalCDOXATransaction.
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.02836 seconds