Tom Jenkinson [
http://community.jboss.org/people/tomjenkinson] created the discussion
"Remote Tx Inflow: Proxying a transaction as an XAResource issue"
To view the discussion, visit:
http://community.jboss.org/message/629876#629876
--------------------------------------------------------------
I have started to implement (
https://svn.jboss.org/repos/labs/labs/jbosstm/branches/JBOSSTS_4_15_0_Fin...
https://svn.jboss.org/repos/labs/labs/jbosstm/branches/JBOSSTS_4_15_0_Fin...) the
planned approach to facilitiate remoting being able to flow a transaction between servers
but have come up against the following issue.
Basically, the plan is to get the transport to register an javax.transaction.xa.XAResource
that can intercept calls to javax.transaction.Transaction lifecycle management calls such
as commit/rollback and relay those over to the remote transaction manager.
This is all looking good until you realise that the signature for XAResource permits fewer
exception types than the corresponding Transaction signature, resulting in a loss of
prescision in the proxy code. As such as I tried to map the javax.transaction.Transaction
exception types for commit/rollback using the available XA error codes.
Just wondered if people can see any issues with the mappings I have done or can spot more
appropriate ones:
try {
remoteManager.commit(xid);
} catch (SecurityException e) {
// This should never happen really as the root TM should have detected this
throw new XAException(XAException.XAER_OUTSIDE);
} catch (RollbackException e) {
throw new XAException(XAException.XA_RBPROTO);
} catch (HeuristicMixedException e) {
throw new XAException(XAException.XA_HEURMIX);
} catch (HeuristicRollbackException e) {
throw new XAException(XAException.XA_HEURRB);
} catch (SystemException e) {
throw new XAException(XAException.XAER_PROTO);
}
try {
remoteManager.rollback(xid);
} catch (IllegalStateException e) {
throw new XAException(XAException.XAER_NOTA);
} catch (SystemException e) {
throw new XAException(XAException.XAER_PROTO);
}
Comments/suggestions?
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/629876#629876]
Start a new discussion in JBoss Transactions Development at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]