Author: kwsutter
Date: Thu Jan 21 18:48:31 2010
New Revision: 901825
URL: http://svn.apache.org/viewvc?rev=901825&view=rev
Log:
OPENJPA-1476. Turning off the QueryCache by default. The new default value
for this property will be "false". Also, disabling the Write Behind testcases.
Modified:
openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java
openjpa/trunk/openjpa-persistence-jdbc/pom.xml
openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/AbstractCacheTestCase.java
openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestBulkJPQLAndDataCache.java
openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/cache/TestQueryDefaultEviction.java
openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/cache/TestQueryTimestampEviction.java
openjpa/trunk/openjpa-project/src/doc/manual/migration_considerations.xml
openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_caching.xml
openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_conf.xml
Modified:
openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java
URL:
http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java?rev=901825&r1=901824&r2=901825&view=diff
==============================================================================
---
openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java
(original)
+++
openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java
Thu Jan 21 18:48:31 2010
@@ -28,7 +28,6 @@
import org.apache.openjpa.datacache.ConcurrentQueryCache;
import org.apache.openjpa.datacache.DataCacheManager;
import org.apache.openjpa.datacache.DataCacheManagerImpl;
-import org.apache.openjpa.datacache.DataCacheMode;
import org.apache.openjpa.datacache.PartitionedDataCache;
import org.apache.openjpa.ee.ManagedRuntime;
import org.apache.openjpa.enhance.RuntimeUnenhancedClassesModes;
@@ -252,11 +251,11 @@
dataCacheTimeout.set(-1);
dataCacheTimeout.setDynamic(true);
- queryCachePlugin = addPlugin("QueryCache", true);
+ queryCachePlugin = addPlugin("QueryCache", false);
aliases = new String[] {
+ "false", null,
"true", ConcurrentQueryCache.class.getName(),
"concurrent", ConcurrentQueryCache.class.getName(),
- "false", null,
};
queryCachePlugin.setAliases(aliases);
queryCachePlugin.setDefault(aliases[0]);
Modified: openjpa/trunk/openjpa-persistence-jdbc/pom.xml
URL:
http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/pom.xml?rev=901825&r1=901824&r2=901825&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/pom.xml (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/pom.xml Thu Jan 21 18:48:31 2010
@@ -965,6 +965,9 @@
<!-- TestEJBTransactionalClass tests nothing -->
<exclude>org/apache/openjpa/persistence/kernel/TestEJBTransactionalClass.java</exclude>
+
+ <!-- Exclude WriteBehind testcases until they are
deleted... -->
+
<exclude>org/apache/openjpa/jdbc/writebehind/**/Test*.java</exclude>
</excludes>
<systemProperties>
<property>
Modified:
openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/AbstractCacheTestCase.java
URL:
http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/AbstractCacheTestCase.java?rev=901825&r1=901824&r2=901825&view=diff
==============================================================================
---
openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/AbstractCacheTestCase.java
(original)
+++
openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cache/jpa/AbstractCacheTestCase.java
Thu Jan 21 18:48:31 2010
@@ -64,6 +64,7 @@
OpenJPAEntityManagerFactorySPI emf =
(OpenJPAEntityManagerFactorySPI)
OpenJPAPersistence.createEntityManagerFactory(puName,
"META-INF/caching-persistence.xml",
getPropertiesMap("openjpa.DataCache", "true",
+ "openjpa.QueryCache", "true",
"openjpa.RemoteCommitProvider", "sjvm", persistentTypes,
"openjpa.jdbc.JDBCListeners", new JDBCListener [] {
getListener() } ));
return emf;
Modified:
openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestBulkJPQLAndDataCache.java
URL:
http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestBulkJPQLAndDataCache.java?rev=901825&r1=901824&r2=901825&view=diff
==============================================================================
---
openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestBulkJPQLAndDataCache.java
(original)
+++
openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestBulkJPQLAndDataCache.java
Thu Jan 21 18:48:31 2010
@@ -34,6 +34,7 @@
public void setUp() throws Exception {
setUp("openjpa.DataCache", "true",
+ "openjpa.QueryCache", "true",
"openjpa.RemoteCommitProvider", "sjvm",
CLEAR_TABLES,
AllFieldTypes.class, CascadeParent.class, CascadeChild.class);
Modified:
openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/cache/TestQueryDefaultEviction.java
URL:
http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/cache/TestQueryDefaultEviction.java?rev=901825&r1=901824&r2=901825&view=diff
==============================================================================
---
openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/cache/TestQueryDefaultEviction.java
(original)
+++
openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/cache/TestQueryDefaultEviction.java
Thu Jan 21 18:48:31 2010
@@ -25,8 +25,7 @@
public void setUp() throws Exception {
super.setUp(
"openjpa.DataCache", "true",
- "openjpa.QueryCache",
- "CacheSize=1000",
+ "openjpa.QueryCache", "true(CacheSize=1000)",
"openjpa.RemoteCommitProvider", "sjvm");
}
Modified:
openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/cache/TestQueryTimestampEviction.java
URL:
http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/cache/TestQueryTimestampEviction.java?rev=901825&r1=901824&r2=901825&view=diff
==============================================================================
---
openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/cache/TestQueryTimestampEviction.java
(original)
+++
openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/cache/TestQueryTimestampEviction.java
Thu Jan 21 18:48:31 2010
@@ -30,8 +30,7 @@
public void setUp() throws Exception {
super.setUp(
"openjpa.DataCache", "true",
- "openjpa.QueryCache",
- "CacheSize=1000, EvictPolicy='timestamp'",
+ "openjpa.QueryCache", "true(CacheSize=1000,
EvictPolicy='timestamp')",
"openjpa.RemoteCommitProvider", "sjvm");
}
Modified:
openjpa/trunk/openjpa-project/src/doc/manual/migration_considerations.xml
URL:
http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/src/doc/manual/migration_considerations.xml?rev=901825&r1=901824&r2=901825&view=diff
==============================================================================
--- openjpa/trunk/openjpa-project/src/doc/manual/migration_considerations.xml
(original)
+++ openjpa/trunk/openjpa-project/src/doc/manual/migration_considerations.xml
Thu Jan 21 18:48:31 2010
@@ -281,6 +281,38 @@
See OPENJPA-1203 for more details.
</para>
</section>
+ <section id="querycache">
+ <title>
+ openjpa.QueryCache default
+ </title>
+ <para>
+ In previous releases, the default value for the
openjpa.QueryCache property was
+ <literal>true</literal> when the openjpa.DataCache was
enabled. Depending on application
+ characteristics, this default QueryCache enablement
actually could negate much of the potential
+ gains achieved by using the DataCache. Thus, the default
value for the openjpa.QueryCache
+ property will now by
<emphasis><literal>false</literal></emphasis>.
+ </para>
+ <para>
+ To re-enable the default QueryCache behavior, you just
need to include the following property
+ into your persistence.xml configuration.
+
+ <programlisting>
+ <property name="openjpa.QueryCache" value="true"/>
+ </programlisting>
+ </para>
+ <para>
+ If your configuration had previously enabled the
QueryCache explicitly, then you might have to
+ include the <literal>true</literal> value into your
configuration (if you relied on the previous
+ default). Otherwise, your current QueryCache enablement
will continue to work.
+
+ <programlisting>
+ <property name="openjpa.QueryCache"
value="true(CacheSize=1000, SoftReferenceSize=100)"/>
+ </programlisting>
+ </para>
+ <para>
+ See OPENJPA-1469 and sub-tasks for more details.
+ </para>
+ </section>
</section>
</section>
</appendix>
Modified: openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_caching.xml
URL:
http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_caching.xml?rev=901825&r1=901824&r2=901825&view=diff
==============================================================================
--- openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_caching.xml
(original)
+++ openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_caching.xml Thu Jan
21 18:48:31 2010
@@ -571,8 +571,8 @@
<para>
In addition to the data cache, the <literal>org.apache.openjpa.datacache
</literal> package defines service provider interfaces for a query cache. The
-query cache is enabled by default when the data cache is enabled. The query
-cache stores the object ids returned by query executions. When you run a query,
+query cache is disabled by default and needs to be enabled separately from the
data cache.
+The query cache stores the object ids returned by query executions. When you
run a query,
OpenJPA assembles a key based on the query properties and the parameters used
at
execution time, and checks for a cached query result. If one is found, the
object ids in the cached result are looked up, and the resultant
@@ -613,11 +613,11 @@
Query Cache Size
</title>
<programlisting>
-<property name="openjpa.QueryCache" value="CacheSize=1000,
SoftReferenceSize=100"/>
+<property name="openjpa.QueryCache" value="true(CacheSize=1000,
SoftReferenceSize=100)"/>
</programlisting>
</example>
<para>
-To disable the query cache completely, set the <literal>openjpa.QueryCache
+To disable the query cache (default), set the <literal>openjpa.QueryCache
</literal> property to <literal>false</literal>:
</para>
<example id="ref_guide_cache_disablequery">
@@ -632,7 +632,7 @@
Query Cache's default behaviour on eviction is to evict all the queries from
the cache if any of the entities that are in the access path of the query are
modified. Scanning through the whole query cache to evict the queries upon an
-entity update slows down the entity updation.
+entity update slows down the entity update action.
The configurable eviction policy "timestamp" is to track the timestamp of the
query and the timestamp of last update for each entity class and compare the
@@ -648,7 +648,7 @@
Query Cache Eviction Policy
</title>
<programlisting>
-<property name="openjpa.QueryCache" value="EvictPolicy='timestamp'"/>
+<property name="openjpa.QueryCache"
value="true(EvictPolicy='timestamp')"/>
</programlisting>
</example>
<para>
@@ -852,9 +852,9 @@
<para>
The provided data cache classes can be easily extended to add additional
functionality. If you are adding new behavior, you should extend <classname>
-org.apache.openjpa.datacache.DataCacheImpl</classname>. To use your own storage
+org.apache.openjpa.datacache.ConcurrentDataCache</classname>. To use your own
storage
mechanism, extend <classname>org.apache.openjpa.datacache.AbstractDataCache
-</classname>, or implement <classname>org.apache.openjpa.datacache.DataCache
+</classname> (preferred), or implement
<classname>org.apache.openjpa.datacache.DataCache
</classname> directly. If you want to implement a distributed cache that uses
an
unsupported method for communications, create an implementation of <classname>
org.apache.openjpa.event.RemoteCommitProvider</classname>. This process is
@@ -863,9 +863,9 @@
</para>
<para>
The query cache is just as easy to extend. Add functionality by extending the
-default <classname>org.apache.openjpa.datacache.QueryCacheImpl</classname>.
+default
<classname>org.apache.openjpa.datacache.ConcurrentQueryCache</classname>.
Implement your own storage mechanism for query results by extending <classname>
-org.apache.openjpa.datacache.AbstractQueryCache</classname> or implementing the
+org.apache.openjpa.datacache.AbstractQueryCache</classname> (preferred) or
implementing the
<classname>org.apache.openjpa.datacache.QueryCache</classname> interface
directly.
</para>
Modified: openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_conf.xml
URL:
http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_conf.xml?rev=901825&r1=901824&r2=901825&view=diff
==============================================================================
--- openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_conf.xml (original)
+++ openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_conf.xml Thu Jan 21
18:48:31 2010
@@ -2780,9 +2780,7 @@
QueryCache</literal>
</para>
<para>
-<emphasis role="bold">Default: </emphasis><literal>true</literal>, when the
data
-cache (see <xref linkend="openjpa.DataCache"/>) is also enabled, <literal>
-false</literal> otherwise.
+<emphasis role="bold">Default: </emphasis><literal>false</literal>
</para>
<para>
<emphasis role="bold">Description:</emphasis> A plugin string (see