addAddReferenceCallback(tx); if (log.isTraceEnabled()) { log.trace("added an Add callback to transaction " + tx); }
   public void add(MessageReference ref, Transaction tx) throws Throwable   {      //We synchronize on the ref to prevent a message being removed from memory      //and failing on attempting to remove from db, because it tries after the message      //is added to memory but before it's been added to db      synchronized (ref)      {               super.add(ref, tx);            if (ref.isReliable())         {            //Reliable message in a recoverable state - also add to db            if (log.isTraceEnabled()) { log.trace("adding " + ref + (tx == null ? " to database non-transactionally" : " in transaction: " + tx)); }            pm.addReference(channelID, ref, tx);         }            if (tx != null)         {            addAddReferenceCallback(tx);            if (log.isTraceEnabled()) { log.trace("added an Add callback to transaction " + tx); }         }      }   }