super.addFirst(ref);  if (ref.isReliable()) {  if (log.isTraceEnabled()) { log.trace("adding " + ref + " to database"); }  pm.add(channelID, ref, null); if (log.isTraceEnabled()) { log.trace("added " + ref + " to database"); }
synchronized (ref) { super.addFirst(ref);  if (ref.isReliable()) {  if (log.isTraceEnabled()) { log.trace("adding " + ref + " to database"); }  pm.add(channelID, ref, null); if (log.isTraceEnabled()) { log.trace("added " + ref + " to database"); } }
   public void addFirst(MessageReference ref) throws Throwable   {      super.addFirst(ref);      if (ref.isReliable())      {         //Reliable message in a recoverable state - also add to db         if (log.isTraceEnabled()) { log.trace("adding " + ref + " to database"); }         // TODO Q1 - have a method that enforces ordering         pm.add(channelID, ref, null);         if (log.isTraceEnabled()) { log.trace("added " + ref + " to database"); }      }   }