public void notifyTransactionTerminated(CompositeTransaction ct){
  boolean notifyOfTerminatedEvent=false;
synchronized (this) {
    boolean alreadyTerminated=isTerminated();
    Iterator<TransactionContext> it=allContexts.iterator();
    while (it.hasNext()) {
      TransactionContext b=it.next();
      b.transactionTerminated(ct);
    }
    if (isTerminated() && !alreadyTerminated)     notifyOfTerminatedEvent=true;
  }
  if (notifyOfTerminatedEvent) {
    if (LOGGER.isTraceEnabled())     LOGGER.logTrace(this + ": all contexts terminated, firing TerminatedEvent for " + this);
    fireTerminatedEvent();
  }
}

public void notifyTransactionTerminated ( CompositeTransaction ct ) { boolean notifyOfTerminatedEvent = false ; synchronized ( this ) { boolean alreadyTerminated = isTerminated ( ) ; Iterator < TransactionContext > it = allContexts . iterator ( ) ; while ( it . hasNext ( ) ) { TransactionContext b = it . next ( ) ; b . transactionTerminated ( ct ) ; } if ( isTerminated ( ) && ! alreadyTerminated ) notifyOfTerminatedEvent = true ; } if ( notifyOfTerminatedEvent ) { if ( LOGGER . isTraceEnabled ( ) ) LOGGER . logTrace ( this + ": all contexts terminated, firing TerminatedEvent for " + this ) ; fireTerminatedEvent ( ) ; } }
notifies the session that the transaction was terminated .
