From: fhanik Date: Mon, 24 Nov 2008 19:27:37 +0000 (+0000) Subject: Add doc, update version number X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=2e47e8c950d389f8af14efd1f0939f83836da674;p=tomcat7.0 Add doc, update version number git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@720267 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/jdbc-pool/build.xml b/modules/jdbc-pool/build.xml index 01010978e..8acb7403f 100644 --- a/modules/jdbc-pool/build.xml +++ b/modules/jdbc-pool/build.xml @@ -23,7 +23,7 @@ - + diff --git a/modules/jdbc-pool/doc/changelog.xml b/modules/jdbc-pool/doc/changelog.xml index af4b46515..383650f66 100644 --- a/modules/jdbc-pool/doc/changelog.xml +++ b/modules/jdbc-pool/doc/changelog.xml @@ -28,7 +28,7 @@ -
+
720253Document how to use interceptors diff --git a/modules/jdbc-pool/doc/jdbc-pool.xml b/modules/jdbc-pool/doc/jdbc-pool.xml index cf44d53e7..9b67fa4a4 100644 --- a/modules/jdbc-pool/doc/jdbc-pool.xml +++ b/modules/jdbc-pool/doc/jdbc-pool.xml @@ -473,6 +473,16 @@ "close".equals(method.getName()). Above we see a direct reference comparison between the method name and static final String reference. According to the JVM spec, method names and static final String end up in a shared constant pool, so the reference comparison should work. + One could of course do this as well: + + + if (compare(CLOSE_VAL,method.getName())) { + if (isClosed()) return null; //noop for already closed. + } + return super.invoke(proxy,method,args); + + The compare(String,Method) will use the useEquals flag on an interceptor and do either reference comparison or + a string value comparison when the useEquals=true flag is set.

Configuring interceptors
Interceptors are configured using the jdbcInterceptors property or the setJdbcInterceptors method. diff --git a/modules/jdbc-pool/sign.sh b/modules/jdbc-pool/sign.sh index 42475d9dc..be2a3265a 100755 --- a/modules/jdbc-pool/sign.sh +++ b/modules/jdbc-pool/sign.sh @@ -1,4 +1,4 @@ -VERSION=v1.0.3-beta +VERSION=v1.0.4-beta for i in $(find output/release/$VERSION -name "*.zip" -o -name "*.tar.gz"); do echo Signing $i echo $1|gpg --passphrase-fd 0 -a -b $i diff --git a/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/SimplePOJOExample.java b/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/SimplePOJOExample.java index 629840750..832f74515 100644 --- a/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/SimplePOJOExample.java +++ b/modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/SimplePOJOExample.java @@ -44,6 +44,7 @@ public class SimplePOJOExample { p.setRemoveAbandonedTimeout(60); p.setMinEvictableIdleTimeMillis(30000); p.setMinIdle(10); + p.setJdbcInterceptors("org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer"); p.setLogAbandoned(true); p.setRemoveAbandoned(true); DataSource datasource = new DataSource();