protected Persistent putInstanceImpl(Serializable key, Persistent om)
throws TorqueException
{
if (getOMClass() != null && !getOMClass().isInstance(om))
{
throw new TorqueException(om + "; class=" + om.getClass().getName()
+ "; id=" + om.getPrimaryKey() + " cannot be cached with "
+ getOMClass().getName() + " objects");
}
Persistent oldOm = null;
if (cache != null)
{
try
{
synchronized (this)
{
oldOm = (Persistent) cache.get(key);
cache.put(key, om);
}
}
catch (CacheException ce)
{
throw new TorqueException
("Could not cache due to internal JCS error", ce);
}
}
return oldOm;
}