Author: kkolinko
Date: Fri Mar 22 19:28:22 2013
New Revision: 1459943

URL: http://svn.apache.org/r1459943
Log:
Merged revision 1459933 from tomcat/trunk:
Documentation for StatementCache interceptor.

Modified:
    tomcat/tc7.0.x/trunk/   (props changed)
    tomcat/tc7.0.x/trunk/modules/jdbc-pool/doc/jdbc-pool.xml
    
tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java

Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
  Merged /tomcat/trunk:r1459933

Modified: tomcat/tc7.0.x/trunk/modules/jdbc-pool/doc/jdbc-pool.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/modules/jdbc-pool/doc/jdbc-pool.xml?rev=1459943&r1=1459942&r2=1459943&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/modules/jdbc-pool/doc/jdbc-pool.xml (original)
+++ tomcat/tc7.0.x/trunk/modules/jdbc-pool/doc/jdbc-pool.xml Fri Mar 22 
19:28:22 2013
@@ -568,6 +568,36 @@
     <attributes>
     </attributes>
   </subsection>
+  <subsection name="org.apache.tomcat.jdbc.pool.interceptor.StatementCache">
+    <p>Caches <code>PreparedStatement</code> and/or 
<code>CallableStatement</code>
+       instances on a connection.
+    </p>
+    <p>The statements are cached per connection.
+       The count limit is counted globally for all connections that belong to
+       the same pool. Once the count reaches <code>max</code>, subsequent
+       statements are not returned to the cache and are closed immediately.
+    </p>
+    <attributes>
+      <attribute name="prepared" required="false">
+        <p>(boolean as String) Enable caching of <code>PreparedStatement</code>
+           instances created using <code>prepareStatement</code> calls.
+           The default value is <code>true</code>.
+        </p>
+      </attribute>
+      <attribute name="callable" required="false">
+        <p>(boolean as String) Enable caching of <code>CallableStatement</code>
+           instances created using <code>prepareCall</code> calls.
+           The default value is <code>false</code>.
+        </p>
+      </attribute>
+      <attribute name="max" required="false">
+        <p>(int as String) Limit on the count of cached statements across
+           the connection pool.
+           The default value is <code>50</code>.
+        </p>
+      </attribute>
+    </attributes>
+  </subsection>
   <subsection 
name="org.apache.tomcat.jdbc.pool.interceptor.StatementDecoratorInterceptor">
     <p>See <bug>48392</bug>. Interceptor to wrap statements and result sets in 
order to prevent access to the actual connection
        using the methods <code>ResultSet.getStatement().getConnection()</code> 
and <code>Statement.getConnection()</code>

Modified: 
tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java?rev=1459943&r1=1459942&r2=1459943&view=diff
==============================================================================
--- 
tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java
 Fri Mar 22 19:28:22 2013
@@ -27,6 +27,10 @@ import org.apache.tomcat.jdbc.pool.Conne
 import org.apache.tomcat.jdbc.pool.PoolProperties.InterceptorProperty;
 import org.apache.tomcat.jdbc.pool.PooledConnection;
 
+/**
+ * Interceptor that caches {@code PreparedStatement} and/or
+ * {@code CallableStatement} instances on a connection.
+ */
 public class StatementCache extends StatementDecoratorInterceptor {
     protected static final String[] ALL_TYPES = new String[] 
{PREPARE_STATEMENT,PREPARE_CALL};
     protected static final String[] CALLABLE_TYPE = new String[] 
{PREPARE_CALL};



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to