processRollback(request.getState());
if (request.getState() != null) {  processRollback(request.getState()); }
   public void sendTransaction(TransactionRequest request) throws JMSException   {      try      {         closeLock.readLock().acquire();      }      catch (InterruptedException e)      {         //Ignore      }      try      {         if (closed)         {            throw new IllegalStateException("Connection is closed");         }                  TransactionRepository txRep = serverPeer.getTxRepository();                  Transaction tx = null;                  try         {                            if (request.getRequestType() == TransactionRequest.ONE_PHASE_COMMIT_REQUEST)            {               if (log.isTraceEnabled()) { log.trace("One phase commit request received"); }                              tx = txRep.createTransaction();               processCommit(request.getState(), tx);               tx.commit();                     }            else if (request.getRequestType() == TransactionRequest.ONE_PHASE_ROLLBACK_REQUEST)            {               if (log.isTraceEnabled()) { log.trace("One phase rollback request received"); }                              //We just need to cancel deliveries               processRollback(request.getState());            }            else if (request.getRequestType() == TransactionRequest.TWO_PHASE_PREPARE_REQUEST)            {                                       if (log.isTraceEnabled()) { log.trace("Two phase commit prepare request received"); }                       tx = txRep.createTransaction(request.getXid());               processCommit(request.getState(), tx);                    tx.prepare();            }            else if (request.getRequestType() == TransactionRequest.TWO_PHASE_COMMIT_REQUEST)            {                  if (log.isTraceEnabled()) { log.trace("Two phase commit commit request received"); }               tx = txRep.getPreparedTx(request.getXid());                  if (log.isTraceEnabled()) { log.trace("committing " + tx); }               tx.commit();            }            else if (request.getRequestType() == TransactionRequest.TWO_PHASE_ROLLBACK_REQUEST)            {               if (log.isTraceEnabled()) { log.trace("Two phase commit rollback request received"); }               tx = txRep.getPreparedTx(request.getXid());                              //We just need to cancel deliveries               processRollback(request.getState());                  if (log.isTraceEnabled()) { log.trace("rolling back " + tx); }               tx.rollback();            }               }         catch (Throwable t)         {            handleFailure(t, tx);         }                  if (log.isTraceEnabled()) { log.trace("Request processed ok"); }      }      finally      {         closeLock.readLock().release();      }   }