Specifies the
ObjectCache implementation used as application cache (second level cache).
By default
ObjectCacheDefaultImpl was used. It's recommended to use a shared cache implementation
(all used PB instances should access the same pool of objects - e.g. by using a static Map in cache
implementation).
copyStrategy
Specifies the implementation class of the
ObjectCacheTwoLevelImpl.CopyStrategy interface, which was used to copy objects on read and write to application cache. If not
specified a default implementation based was used (
ObjectCacheTwoLevelImpl.CopyStrategyImpl make field-descriptor based copies of the cached objects).
forceProxies
If true on materialization of cached objects, all referenced objects will
be represented by proxy objects (independent from the proxy settings in reference- or
collection-descriptor).
Note: To use this feature all persistence capable objects have to be
interface based or the ProxyFactory and
IndirectionHandler implementation classes supporting dynamic proxy enhancement
for all classes (see OJB.properties file).
afterCommit(PBStateEvent event) After committing the transaction push the object
from session cache ( 1st level cache) to the application cache
(2d level cache).
lookup(Identity oid) Lookup corresponding object from session cache or if not found from
the underlying real
ObjectCache - Return null if no
object was found.
After committing the transaction push the object
from session cache ( 1st level cache) to the application cache
(2d level cache). Finally, clear the session cache.
Cache the given object. Creates a
org.apache.ojb.broker.cache.ObjectCacheTwoLevelImpl.CacheEntry and put it
to session cache. If the specified object to cache is of type
ObjectCacheTwoLevelImpl.TYPE_NEW_MATERIALIZED it will be immediately pushed to the application cache.
Lookup corresponding object from session cache or if not found from
the underlying real
ObjectCache - Return null if no
object was found.
materializeFullObject
public void materializeFullObject(Object target)(Code)
This cache implementation cache only "flat" objects (persistent objects without any
references), so when
ObjectCacheTwoLevelImpl.lookup(org.apache.ojb.broker.Identity) a cache object
it needs full materialization (assign all referenced objects) before the cache returns
the object. The materialization of the referenced objects based on the auto-XXX settings
specified in the metadata mapping.
Override this method if needed in conjunction with a user-defined
org.apache.ojb.broker.cache.ObjectCacheTwoLevelImpl.CopyStrategy .
Parameters: target - The "flat" object for full materialization