catch (Throwable e) {}
catch (Throwable t) { }
   public void addReference(Serializable channelID, MessageReference ref, Transaction tx) throws Exception   {      if (log.isTraceEnabled()) { log.trace("Adding message reference " + ref + " for channel "  + channelID + (tx == null ? " non-transactionally" : " in transaction: " + tx));}      Connection conn = null;      PreparedStatement ps = null;      TransactionWrapper wrap = new TransactionWrapper();      try      {         conn = ds.getConnection();                           insertTx(conn, tx);         String state;         if (tx == null)         {            state = "C";         }         else         {            state = "+";         }                  ps = conn.prepareStatement(insertMessageRef);         ps.setString(1, (String)channelID);         ps.setString(2, (String)ref.getMessageID());         ps.setString(3, (String)ref.getStoreID());         if (tx == null)         {            if (this.txIdGUID)            {               ps.setNull(4, java.sql.Types.VARCHAR);            }            else            {               ps.setNull(4, java.sql.Types.BIGINT);            }         }         else         {            if (this.txIdGUID)            {               ps.setString(4, tx.getGuidTxId());            }            else            {               ps.setLong(4, tx.getLongTxId());            }         }         ps.setString(5, (String)state);         ps.setLong(6, ref.getOrdering());         int inserted = ps.executeUpdate();                  if (log.isTraceEnabled())         {            log.trace(JDBCUtil.statementToString(insertMessageRef, channelID, ref.getMessageID(), ref.getStoreID(),                  getTxId(tx), state, new Long(ref.getOrdering())) + " inserted " + inserted + " row(s)");         }      }      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();      }   }