if (this.loadFromOrderingValue == 0) {  this.loadFromOrderingValue = minOrdering; } else {         if (minOrdering < loadFromOrderingValue) { loadFromOrderingValue = minOrdering; } }
   protected void flushDownCache() throws Exception   {      if (trace) { log.trace(this + " flushing " + downCache.size() + " refs from downcache"); }                        //Non persistent refs or persistent refs in a non recoverable state won't already be in the db      //so they need to be inserted      //Persistent refs in a recoverable state will already be there so need to be updated            List toUpdate = new ArrayList();            List toAdd = new ArrayList();            Iterator iter = downCache.iterator();            while (iter.hasNext())      {         MessageReference ref = (MessageReference)iter.next();                  if (ref.isReliable() && recoverable)         {            toUpdate.add(ref);         }         else         {            toAdd.add(ref);         }      }            if (!toAdd.isEmpty())      {         pm.addReferences(channel.getChannelID(), toAdd, false);      }      if (!toUpdate.isEmpty())      {         pm.updateReferencesNotLoaded(channel.getChannelID(), toUpdate);      }            //Release in memory refs for the refs we just spilled      //Note! This must be done after the db inserts - to ensure message is still in memory      iter = downCache.iterator();            while (iter.hasNext())      {         MessageReference ref = (MessageReference)iter.next();                  ref.releaseMemoryReference();      }                 downCache.clear();                        if (trace) { log.trace(this + " cleared downcache"); }   }