Description
The scenario was as follows:
enlist jms xaresource
do some work
delist jms xaresource
enlist jdbc xaresource
do some work which results in a failure(inserting NULL into a non null column for example)
delist jdbc xaresource with TMFAIL flag.
call tm.rollback()
During rollback, an exception in XARerource.end() as follows: oracle.jdbc.xa.OracleXAException with error code=-3
It appears that end is called, in rollback, although already been called in delist.
I think the resolution is to change, endAssociation of narayana-full-5.0.0.M2src/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore/XAResourceRecord.java from:
if (_theTransaction.getXAResourceState(_theXAResource) == TxInfo.NOT_ASSOCIATED)
to:
int txInfo = _theTransaction.getXAResourceState(_theXAResource);
if ((txInfo == TxInfo.NOT_ASSOCIATED) || (txInfo == TxInfo.FAILED))
This fix works for JBossTS 4.2.3 and JBossTS 4.3, haven't been able test it Narayana 5.0.0.M2 yet, as Fedora 18 doesn't seem to be a supported build/test environment.