Hi Marc, OpenJPA's 2nd level cache is more of a look-aside cache. We use it to help circumvent unnecessary trips to the database The cache interface is not transactional (yet). That is, OpenJPA runtime determines when to "commit" or "rollback" the contents of the cache. Supporting a transactional interface is not requirement of the cache plugin. The cache contents are kept consistent based on the locking mechanisms used to access the Entities. Much of this consistency is based on the optimistic locking paradigm. There is a chance of getting stale data, but attempting to commit stale data will be detected during the optimistic version checking. Stronger locking mechanisms (such as pessimistic) will bypass the cache and work directly with the database to ensure consistency.
OpenJPA does allow for a pluggable cache implementation. We provide our own internal implementation, which performs quite well. But, we also support an EHCache plugin and a WebSphere Extreme Scale plugin. More information on OpenJPA's 2nd level cache can be found here: http://openjpa.apache.org/builds/2.0.0/apache-openjpa-2.0.0/docs/manual/manual.html#ref_guide_cache Kevin On Wed, Aug 25, 2010 at 3:58 PM, killbulle <[email protected]> wrote: > > Not an easy subject.. > as an old hibernate user i found a good link for the isolation level and > the > second level cache > > http://clustermania.blogspot.com/2009/07/with-read-write-hibernate-2nd-level.html > and as a new openJPA user and fan, i ask myself if the datacache implements > similar mecanism to warranty some consistency > Regards > Marc > NB(i plan to read the code:), but this is a tricky part) > -- > View this message in context: > http://openjpa.208410.n2.nabble.com/Datacache-and-isolation-level-and-advice-tp5463092p5463092.html > Sent from the OpenJPA Users mailing list archive at Nabble.com. >
