public synchronized void resumeAssociation ( boolean allowSetRollback ) throws TRANSACTION_ROLLEDBACK { final boolean traceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( traceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "resumeAssociation" , allowSetRollback ) ; // if another thread is active we have to wait // doSetRollback indicates if this method has marked the transaction for rollbackOnly // and if so TRANSACTION_ROLLEDBACK exception is thrown. boolean doSetRollback = false ; while ( _activeAssociations > _suspendedAssociations ) { doSetRollback = allowSetRollback ; try { if ( doSetRollback && ! _rollbackOnly ) setRollbackOnly ( ) ; } catch ( Exception ex ) { FFDCFilter . processException ( ex , "com.ibm.ws.Transaction.JTA.TransactionImpl.resumeAssociation" , "1748" , this ) ; if ( traceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "setRollbackOnly threw exception" , ex ) ; // swallow this exception } try { wait ( ) ; } // woken up by removeAssociation catch ( InterruptedException iex ) { /* no ffdc */ } } // end while _suspendedAssociations -- ; if ( doSetRollback ) { if ( traceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "resumeAssociation throwing rolledback" ) ; throw new TRANSACTION_ROLLEDBACK ( "Context already active" ) ; } if ( traceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "resumeAssociation" ) ; }
This polices the single threaded operation of the transaction . allowSetRollback indicates whether the condition where there is already an active association should result in rolling back the transaction .