protected void terminate(boolean commit) throws HeurRollbackException, HeurMixedException, SysException, java.lang.SecurityException, HeurCommitException, HeurHazardException, RollbackException, IllegalStateException {
synchronized (fsm_) {
    if (commit) {
      if (participants_.size() <= 1) {
        commit(true);
      }
 else {
        int prepareResult=prepare();
        if (prepareResult != Participant.READ_ONLY)         commit(false);
      }
    }
 else {
      rollback();
    }
  }
}

protected void terminate ( boolean commit ) throws HeurRollbackException , HeurMixedException , SysException , java . lang . SecurityException , HeurCommitException , HeurHazardException , RollbackException , IllegalStateException { synchronized ( fsm_ ) { if ( commit ) { if ( participants_ . size ( ) <= 1 ) { commit ( true ) ; } else { int prepareResult = prepare ( ) ; if ( prepareResult != Participant . READ_ONLY ) commit ( false ) ; } } else { rollback ( ) ; } } }
terminate the work , on behalf of terminator .
