Author: ppoddar
Date: Thu Apr 29 18:36:37 2010
New Revision: 939447
URL: http://svn.apache.org/viewvc?rev=939447&view=rev
Log:
Documentation on QueryCache Statistics
Modified:
openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_caching.xml
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=939447&r1=939446&r2=939447&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 Apr
29 18:36:37 2010
@@ -1146,7 +1146,7 @@ Disables the compilation cache.
</indexterm>
<para>
Prepared SQL Cache caches SQL statements corresponding to JPQL queries.
-If a JPQL query is executed more than once in the same or different persistence
+If a query is executed more than once in the same or different persistence
contexts, the SQL statement generated during the first execution is cached and
executed directly for subsequent execution. Direct execution of SQL offers
significant performance gain as it saves the cost of parsing query string and,
@@ -1164,7 +1164,14 @@ Prepared SQL Cache is configured by the
<literal>openjpa.jdbc.QuerySQLCache</literal></link> configuration property.
This
property accepts a plugin string (see <xref linkend="ref_guide_conf_plugins"/>)
with value of <literal>true</literal> or <literal>false</literal>. The default
-is <literal>true</literal>.
+is <literal>true</literal>. The execution statistics of the cached queries can
be
+optionally collected as
+<programlisting>
+ <property name="openjpa.jdbc.QuerySQLCache"
value="true(EnableStatistics=true)">
+</programlisting>
+The <ulink url="../javadoc/org/apache/openjpa/kerenl/QueryStatistics.html">
+<code>QueryStatistics</code></ulink> can be accessed via
<code>PreparedQueryCache.getStatistics()</code>.
+
</para>
<table>
<title>
@@ -1250,7 +1257,7 @@ Following salient points to be noted reg
<programlisting>
String jpql = "SELECT p FROM Person p WHERE p.name=:name";
List johns =
em.createQuery(jpql).setParameter("name","John").getResultList();
- List toms =
em.createQuery(jpql).setParameter("name","John").getResultList();
+ List toms =
em.createQuery(jpql).setParameter("name","Tom").getResultList();
</programlisting>
</example>
</para>