Author: kkolinko
Date: Fri Mar 22 19:13:21 2013
New Revision: 1459933
URL: http://svn.apache.org/r1459933
Log:
Documentation for StatementCache interceptor.
Modified:
tomcat/trunk/modules/jdbc-pool/doc/jdbc-pool.xml
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java
Modified: tomcat/trunk/modules/jdbc-pool/doc/jdbc-pool.xml
URL:
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/doc/jdbc-pool.xml?rev=1459933&r1=1459932&r2=1459933&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/doc/jdbc-pool.xml (original)
+++ tomcat/trunk/modules/jdbc-pool/doc/jdbc-pool.xml Fri Mar 22 19:13:21 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/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java?rev=1459933&r1=1459932&r2=1459933&view=diff
==============================================================================
---
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java
(original)
+++
tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java
Fri Mar 22 19:13:21 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: [email protected]
For additional commands, e-mail: [email protected]