Hi
JDO requires a cache per PersistenceManager. Each PM manages its cache, and the lifecycles and state transitions of objects in the cache are specified in significant detail. In one PM's cache, at most one object may exist with a given persistent identity. So if you get a reference to the *same* persistent Employee object within one PM, no matter how you got that reference you are guarranteed that you all references will address the *same*
Java object (i.e. == will hold true).
A Second Level cache ("Level-2" cache, "L2" cache) manages instances across multiple PMs, usually on a per-PersistenceManagerFactory basis.
The JDO 2.0 specification includes an interface (CacheManager) for interacting with an L2 cache should it exist, with methods to pin/unpin objects, etc. If no L2 cache is present then these operations are guarranteed to be NOPs, so the application code is portable and does not rely on the presence of an L2 cache.
That's all the spec says about L2 cache. Kodo comes with an L2 cache implementation which makes access to objects more efficient, caches compiled queries, caches fully iterated query results, etc. The basic mechanism is eviction-based. For even more scalability just plug in Coherence.
Does that help?
Kind regards, Robin.