public int prepare(Xid xid, ConnectionDelegate connection) throws XAException
protected int prepare(Xid xid, ConnectionDelegate connection) throws XAException
   public int prepare(Xid xid, ConnectionDelegate connection) throws XAException   {      if (trace) { log.trace("preparing " + xid); }            TxState state = getTx(xid);      if (state == null)      {         log.error("Cannot find transaction with xid:" + xid);                  throw new XAException(XAException.XAER_NOTA);      }       TransactionRequest request =         new TransactionRequest(TransactionRequest.TWO_PHASE_PREPARE_REQUEST, xid, state);      sendTransactionXA(request, connection);            state.setState(TxState.TX_PREPARED);      return XAResource.XA_OK;   }