conn = ds.getConnection();
conn = getConnection();
   public void updateReferencesNotLoaded(long channelID, List references) throws Exception   {      Connection conn = null;      PreparedStatement psUpdateReference = null;        TransactionWrapper wrap = new TransactionWrapper();            if (trace)      {         log.trace("Updating references to not loaded for channel:" + channelID);      }              try      {         conn = ds.getConnection();                  Iterator iter = references.iterator();                  if (usingBatchUpdates)         {            psUpdateReference = conn.prepareStatement(updateMessageRefNotLoaded);         }                  while (iter.hasNext())         {            MessageReference ref = (MessageReference) iter.next();                             if (!usingBatchUpdates)            {               psUpdateReference = conn.prepareStatement(updateMessageRefNotLoaded);            }                        psUpdateReference.setLong(1, ref.getMessageID());                        psUpdateReference.setLong(2, channelID);                        if (usingBatchUpdates)            {               psUpdateReference.addBatch();            }            else            {               int rows = psUpdateReference.executeUpdate();                              if (trace)               {                  log.trace("Updated " + rows + " rows");               }                              psUpdateReference.close();               psUpdateReference = null;            }         }                              if (usingBatchUpdates)         {            int[] rowsReference = psUpdateReference.executeBatch();                        if (trace)            {               logBatchUpdate(updateMessageRefNotLoaded, rowsReference, "updated");            }                                    psUpdateReference.close();            psUpdateReference = null;         }      }      catch (Exception e)      {         wrap.exceptionOccurred();         throw e;      }      finally      {         if (psUpdateReference != null)         {            try            {               psUpdateReference.close();            }            catch (Throwable t)            {            }         }         if (conn != null)         {            try            {               conn.close();            }            catch (Throwable t)            {            }         }         wrap.end();      }         }