return getHeuristicMessages ();
if ( state_.equals ( TxState.HEUR_MIXED ) )
throw new HeurMixedException ( getHeuristicMessages () );
if ( state_.equals ( TxState.HEUR_COMMITTED ) )
throw new HeurCommitException ( getHeuristicMessages () );
if ( xaresource_ == null ) {
Configuration.logWarning ( "XAResourceTransaction " + getXid ()
+ ": no XAResource to rollback - the required resource is probably not yet intialized?" );
throw new HeurHazardException ( getHeuristicMessages () );
}
// xaresource is null if recovery failed
try {
if ( state_.equals ( TxState.ACTIVE ) )// first suspend xid
suspend ();
// refresh xaresource for MQSeries: seems to close XAResource after
// suspend???
testOrRefreshXAResourceFor2PC ();
printMsg ( "XAResource.rollback ( " + xidToHexString (xid_) + " ) "
+ "on resource " + resourcename_
+ " represented by XAResource instance " + xaresource_,
Console.INFO );
xaresource_.rollback ( xid_ );
} catch ( ResourceException resErr ) {
// failure of suspend
errors.push ( resErr );
throw new SysException ( "Error in rollback: "
+ resErr.getMessage (), errors );
} catch ( XAException xaerr ) {
String msg = interpretErrorCode ( resourcename_ , "rollback" , xid_ , xaerr.errorCode );
if ( (XAException.XA_RBBASE <= xaerr.errorCode)
&& (xaerr.errorCode <= XAException.XA_RBEND) ) {
// do nothing, corresponds with semantics of rollback
Configuration.logDebug ( msg );
} else {
Configuration.logWarning ( msg , xaerr );
switch ( xaerr.errorCode ) {
case XAException.XA_HEURHAZ:
switchToHeuristicState ( "rollback" , TxState.HEUR_HAZARD , xaerr );
throw new HeurHazardException ( getHeuristicMessages() );
case XAException.XA_HEURMIX:
switchToHeuristicState ( "rollback" , TxState.HEUR_MIXED , xaerr );
throw new HeurMixedException ( getHeuristicMessages () );
case XAException.XA_HEURCOM:
switchToHeuristicState ( "rollback", TxState.HEUR_COMMITTED , xaerr );
throw new HeurCommitException ( getHeuristicMessages () );
case XAException.XA_HEURRB:
forget ();
break;
case XAException.XAER_NOTA:
//see case 21552