code: private void putToSessionCache(Identity oid, CacheEntry entry, boolean onlyIfNew)
      {
          if(onlyIfNew)
          {
              // no synchronization needed, because session cache was used per broker instance
              if(!sessionCache.containsKey(oid)) sessionCache.put(oid, entry);
          }
          else
          {
              sessionCache.put(oid, entry);
          }
      }
docs: Put object to session cache.
  
  @param oid The {@link org.apache.ojb.broker.Identity} of the object to cache
  @param entry The {@link org.apache.ojb.broker.cache.ObjectCacheTwoLevelImpl.CacheEntry} of the object
  @param onlyIfNew Flag, if set <em>true</em> only new objects (not already in session cache) be cached.