ref.incrementChannelCount();
      public void afterCommit(boolean onePhase)      {         //We add the reference to the state                  if (trace) { log.trace(this + ": adding " + ref + " to non-recoverable state"); }                  ref.incrementChannelCount();                           boolean first = false;         try         {                     synchronized (refLock)            {               first = addReferenceInMemory(ref);            }         }         catch (Throwable t)         {            // FIXME  - Sort out this exception handling            log.error("Failed to add reference", t);         }                              if (first)         {            //No need to call prompt delivery if there are already messages in the queue            channel.deliver(null);         }      } 