Details
Description
The JPA 2.0 spec introduces a new persistence unit definition element, <shared-cache-mode>, which accepts NONE, ALL, ENABLE_SELECTIVE, and DISABLE_SELECTIVE. The JPA 2.0 spec section 3.7.1 documents the behavior of each of those modes.
What I am curious about is if the use of <shared-cache-mode> should implicitly enable OpenJPA's data cache plugin. Currently, the above element is completely ignored if the persistence unit is missing the properties: openjpa.DataCache=true and openjpa.RemoteCommitProvider=sjvm (because by default, OpenJPA disables data caching). My interpretation of the spec suggests that <shared-cache-mode> is not only a platform-independent method of instructing the data cache which entities are eligible for admittance to the data cache, but it is also a switch providing a platform-independent method of both turning the data cache on or off (since whether the cache is enabled by default is platform-specific). Otherwise, why have a NONE value, if it was not intended to be a platform independent means of turning the data cache off?