protected synchronized void terminate ( int reason ) throws ObjectManagerException { final String methodName = "terminate" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName , new Object [ ] { new Integer ( reason ) } ) ; if ( transactionReference != null ) { Transaction transaction = ( Transaction ) transactionReference . get ( ) ; /** * PM00131 - transaction is coming from a WeakReference, check it isn't null. * If we've lost the reference, there isn't any point making a new one * just to set a reason code on it. Nobody will have a reference to the * new object with which to retrieve the code. **/ if ( transaction != null ) transaction . setTerminationReason ( reason ) ; } setState ( nextStateForTerminate ) ; // Any attempt by any therad to do anything with this Transaction // from now on will result in a StateErrorException. if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , methodName ) ; }
Permanently disable use of this transaction . reason the Transaction . terininatedXXX reason