public synchronized boolean isTerminated(){
  boolean terminated=true;
  Iterator<TransactionContext> it=allContexts.iterator();
  while (it.hasNext()) {
    TransactionContext b=(TransactionContext)it.next();
    if (b.isTerminated()) {
      it.remove();
    }
 else     terminated=false;
  }
  if (terminated)   currentContext=null;
  return terminated;
}

public synchronized boolean isTerminated ( ) { boolean terminated = true ; Iterator < TransactionContext > it = allContexts . iterator ( ) ; while ( it . hasNext ( ) ) { TransactionContext b = ( TransactionContext ) it . next ( ) ; if ( b . isTerminated ( ) ) { it . remove ( ) ; } else terminated = false ; } if ( terminated ) currentContext = null ; return terminated ; }
checks if the session handle is terminated ( i . e . , can be discarded ) and the underlying vendor xa connection / session can be reused or destroyed .
