if (log.isTraceEnabled()) { log.trace("Removed " + rows + " rows from DELIVERY"); }
if (log.isTraceEnabled()) { log.trace(JDBCUtil.statementToString(sql, String.valueOf(tx.getID())) + " removed " + rows + " row(s)"); }
   public void commitTx(Transaction tx) throws Exception   {      if (log.isTraceEnabled()) { log.trace("Committing transaction:" + tx.getID()); }            Connection conn = null;      PreparedStatement ps = null;            TransactionWrapper wrap = new TransactionWrapper();      try      {         conn = ds.getConnection();                        String sql = "DELETE FROM DELIVERY WHERE STATE='-' AND TRANSACTIONID=?";            ps = conn.prepareStatement(sql);         ps.setString(1, String.valueOf(tx.getID()));                  int rows = ps.executeUpdate();                  if (log.isTraceEnabled()) { log.trace("Removed " + rows + " rows from DELIVERY"); }                  sql = "UPDATE MESSAGE_REFERENCE SET STATE='C', TRANSACTIONID=? WHERE STATE='+' AND TRANSACTIONID=?";         ps.close();         ps = conn.prepareStatement(sql);         ps.setNull(1, Types.VARCHAR);         ps.setString(2, String.valueOf(tx.getID()));                  rows = ps.executeUpdate();                  removeTXRecord(conn, tx);                  if (log.isTraceEnabled()) { log.trace("Updated " + rows + " rows in MESSAGE_REFERENCES"); }                               }      catch (SQLException e)      {         wrap.exceptionOccurred();         throw e;      }      finally      {                  if (ps != null)         {            try            {               ps.close();            }            catch (Throwable e)            {}         }         if (conn != null)         {            try            {               conn.close();            }            catch (Throwable e)            {}         }         wrap.end();      }   }