TransactionRequest request = new TransactionRequest(); request.requestType = TransactionRequest.ONE_PHASE_COMMIT_REQUEST; request.txInfo = tx; sendTransactionXA(request);
TransactionRequest request = new TransactionRequest(TransactionRequest.ONE_PHASE_COMMIT_REQUEST, null, tx); request.state = tx; sendTransactionXA(request, connection);
   public void commit(Xid xid, boolean onePhase) throws XAException   {      if (log.isTraceEnabled()) { log.trace("Commiting xid=" + xid + ", onePhase=" + onePhase); }            TxState tx = removeTx(xid);            //Invalid xid      if (tx == null)      {         log.error("Cannot find transaction with xid:" + xid);                  throw new XAException(XAException.XAER_NOTA);      }            if (onePhase)      {         TransactionRequest request = new TransactionRequest();         request.requestType = TransactionRequest.ONE_PHASE_COMMIT_REQUEST;                  request.txInfo = tx;             sendTransactionXA(request);      }      else      {         if (tx.state != TxState.TX_PREPARED)         {            log.error("commit called for transaction, but it is not prepared");                     throw new XAException(XAException.XAER_PROTO);         }         TransactionRequest request = new TransactionRequest();         request.xid = xid;         request.requestType = TransactionRequest.TWO_PHASE_COMMIT_COMMIT_REQUEST;                  sendTransactionXA(request);      }      tx.state = TxState.TX_COMMITED;   }