public void end ( PersistentTranId ptid , int flags ) throws XidUnknownException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "end" , new Object [ ] { "PersistentTranId=" + ptid , xaFlagsToString ( flags ) } ) ; // Defect 455354 // We need to make sure that any changes to the association // lists occur under a lock. synchronized ( _associationLock ) { TransactionParticipant tran = _associatedTrans . remove ( ptid ) ; if ( tran != null ) { // If we are suspending then we need to store the // tran in a different list so that it can be // resumed later. if ( ( flags & XAResource . TMSUSPEND ) != 0 ) { _suspendedTrans . put ( ptid , tran ) ; } else { _unassociatedTrans . put ( ptid , tran ) ; } } else { // Feature SIB0048c.ms.1 // The JTA spec also allows end(TMSUCCESS) on XIDs that // have previously been suspended so we need to check the // suspended list if the XID supplied is not currently // associated. if ( _suspendedTrans . containsKey ( ptid ) ) { // If the flags are TMSUCCESS or TMFAIL then we can move this // XID to the unassociated list as it is now ready for // completion. Otherwise we assume the flags are TMSUSPEND if ( ( ( flags & XAResource . TMSUCCESS ) != 0 ) || ( ( flags & XAResource . TMFAIL ) != 0 ) ) { tran = _suspendedTrans . remove ( ptid ) ; _unassociatedTrans . put ( ptid , tran ) ; } } else { // Defect 373006.3 // If the Xid is in the unassociated list then we can assume // this is a duplicate end from a TMJOIN case. This at least // allows us to maintain better error checking for a // completely unknown Xid. if ( ! _unassociatedTrans . containsKey ( ptid ) ) { XidUnknownException xue = new XidUnknownException ( "XID_NOT_RECOGNISED_SIMS1007" , new Object [ ] { "end(XID)" , ptid . toTMString ( ) } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Cannot disassociate from this Xid. It is not currently associated!" , xue ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "end" ) ; throw xue ; } } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "end" ) ; }
later point .