LocalTx tx = getTx(Xid); if (tx.getMessages().size() > 0 || tx.getAcks().size() > 0) { log.debug("There is stuff to send"); sd.sendTransaction(tx); } transactions.remove(Xid);
try { TxInfo tx = getTx(Xid); if (tx.getMessages().size() > 0 || tx.getAcks().size() > 0) { log.debug("There is stuff to send"); connection.sendTransaction(tx); } } catch (Throwable t) { log.error("Failed to commit tx", t); throw new TransactionRolledBackException("Failed to commit tx: " + t.getMessage()); } finally { transactions.remove(Xid); }
   public Object commit(Object Xid, SessionDelegate sd) throws JMSException   {      log.debug("Committing tx: " + Xid);      LocalTx tx = getTx(Xid);      if (tx.getMessages().size() > 0 || tx.getAcks().size() > 0)      {         log.debug("There is stuff to send");         sd.sendTransaction(tx);      }      transactions.remove(Xid);      return createLocalTx();   }