public void rollback ( ) throws SIIncorrectCallException , SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "rollback" ) ; if ( _state != TransactionState . STATE_ACTIVE ) { SIIncorrectCallException sie = new SIIncorrectCallException ( nls . getFormattedMessage ( "CANNOT_ROLLBACK_COMPLETE_SIMS1005" , new Object [ ] { } , null ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Cannot rollback Transaction. Transaction is complete or completing!" , sie ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "rollback" ) ; throw sie ; } _state = TransactionState . STATE_ROLLINGBACK ; try { // We are rolling back all changes so we don't need // to tell the persistence layer to do anything we // just need to get the in memory model to back out // its changes. if ( _workList != null ) { _workList . rollback ( this ) ; } _state = TransactionState . STATE_ROLLEDBACK ; } catch ( Throwable t ) { com . ibm . ws . ffdc . FFDCFilter . processException ( t , "com.ibm.ws.sib.msgstore.transactions.MSDelegatingLocalTransaction.rollback" , "1:539:1.51.1.14" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Exception caught during rollback phase of transaction!" , t ) ; throw new SIResourceException ( nls . getFormattedMessage ( "COMPLETION_EXCEPTION_SIMS1002" , new Object [ ] { t } , null ) , t ) ; } finally { // We always ensure that all afterCompletion // callbacks are called even in the case of // rollback. // Defect 316887 try { if ( _workList != null ) { _workList . postComplete ( this , false ) ; } for ( int i = 0 ; i < _callbacks . size ( ) ; i ++ ) { TransactionCallback callback = ( TransactionCallback ) _callbacks . get ( i ) ; callback . afterCompletion ( this , false ) ; } } catch ( Throwable t ) { com . ibm . ws . ffdc . FFDCFilter . processException ( t , "com.ibm.ws.sib.msgstore.transactions.MSDelegatingLocalTransaction.rollback" , "1:565:1.51.1.14" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Exception caught during post rollback phase of transaction!" , t ) ; // We aren't going to rethrow this exception as if // a previous exception has been thrown outside the // finally block it is likely to have more // information about the root problem. } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "rollback" ) ; } }
Rollback all work associated with this local transaction .