public void localRollback ( ) { log . info ( "Rollback was called, do rollback on current connection " + con ) ; if ( ! this . isInLocalTransaction ) { throw new PersistenceBrokerException ( "Not in transaction, cannot abort" ) ; } try { //truncate the local transaction this . isInLocalTransaction = false ; if ( ! broker . isManaged ( ) ) { if ( batchCon != null ) { batchCon . rollback ( ) ; } else if ( con != null && ! con . isClosed ( ) ) { con . rollback ( ) ; } } else { if ( log . isEnabledFor ( Logger . INFO ) ) log . info ( "Found managed environment setting in PB, will ignore rollback call on connection, this should be done by JTA" ) ; } } catch ( SQLException e ) { log . error ( "Rollback on the underlying connection failed" , e ) ; } finally { try { restoreAutoCommitState ( ) ; } catch ( OJBRuntimeException ignore ) { // Ignore or log exception } releaseConnection ( ) ; } }
Call rollback on the underlying connection .