|
An overview of DataNucleus caching can be seen here.
As mentioned earlier, DataNucleus provides a simple wrapper to
Oracle's Coherence caches.
This currently takes the
NamedCache
interface in Tangosol and instantiates a cache of a user
provided name. To enabled this you should set the following properties as input to the
PersistenceManagerFactory/EntityManagerFactory
datanucleus.cache.level2=true
datanucleus.cache.level2.type=tangosol
datanucleus.cache.level2.cacheName={tangosol cache name}
The
Coherence cache name
is the name that you would normally put into a call to
CacheFactory.getCache(name). As mentioned earlier, this cache does not support the
pin/unpin
operations found in the standard JDO 2 interface. However you do have the benefits of Oracle's
distributed/serialized caching. If you require more control over the Coherence cache whilst using it
with DataNucleus, you can just access the cache directly via
DataStoreCache cache = pmf.getDataStoreCache();
NamedCache tangosolCache = ((TangosolLevel2Cache)cache).getTangosolCache();
|
|