The session cache act as a temporary storage for all read/store operations of persistent objects
and only on commit or close of the used PB instance the buffered objects of type
ObjectCacheInternal.TYPE_WRITE will be written to the application cache. Except objects of type
ObjectCacheInternal.TYPE_NEW_MATERIALIZED these objects will be immediatly pushed to application cache.

The application cache

Property Key

Property Values

applicationCache

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).

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).

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.

void

materializeFullObject(java.lang.Object target)
This cache implementation cache only "flat" objects (persistent objects without any
references), so when lookup(org.apache.ojb.broker.Identity) a cache object
it needs full materialization (assign all referenced objects) before the cache returns
the object.

doInternalCache

Cache the given object. Creates a
ObjectCacheTwoLevelImpl.CacheEntry and put it
to session cache. If the specified object to cache is of type ObjectCacheInternal.TYPE_NEW_MATERIALIZED
it will be immediately pushed to the application cache.

The cached object or null if no matching object for
specified Identity is found.

materializeFullObject

public void materializeFullObject(java.lang.Object target)

This cache implementation cache only "flat" objects (persistent objects without any
references), so when 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
ObjectCacheTwoLevelImpl.CopyStrategy.

cacheIfNew

For internal use within ObjectCache implementations or to
build two-level caches. Handle with care.

Used to cache new objects (not already cached) by it's
Identity. This method was used to
cache new materialized objects and should work as a "atomic" method
(the check and the put of the object should be atomic) to avoid
concurrency problems.

Currently it's not mandatory that all ObjectCache implementations
support this method, so in some cases it's allowed to delegate this
method call to the standard cache.