tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kfuj...@apache.org
Subject svn commit: r1753456 - in /tomcat/tc8.0.x/trunk: modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java webapps/docs/changelog.xml
Date Wed, 20 Jul 2016 06:28:35 GMT
Author: kfujino
Date: Wed Jul 20 06:28:35 2016
New Revision: 1753456

URL: http://svn.apache.org/viewvc?rev=1753456&view=rev
Log:
Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=59850
Ensure that the ResultSet is closed when enabling the StatementCache interceptor.

Modified:
    tomcat/tc8.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java
    tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml

Modified: tomcat/tc8.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java?rev=1753456&r1=1753455&r2=1753456&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java
(original)
+++ tomcat/tc8.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java
Wed Jul 20 06:28:35 2016
@@ -18,6 +18,7 @@ package org.apache.tomcat.jdbc.pool.inte
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
+import java.sql.ResultSet;
 import java.sql.Statement;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
@@ -237,6 +238,11 @@ public class StatementCache extends Stat
                 //cache a proxy so that we don't reuse the facade
                 CachedStatement proxy = new CachedStatement(getDelegate(),getSql());
                 try {
+                    // clear Resultset
+                    ResultSet result = getDelegate().getResultSet();
+                    if (result != null && !result.isClosed()) {
+                        result.close();
+                    }
                     //create a new facade
                     Object actualProxy = getConstructor().newInstance(new Object[] { proxy
});
                     proxy.setActualProxy(actualProxy);

Modified: tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml?rev=1753456&r1=1753455&r2=1753456&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml Wed Jul 20 06:28:35 2016
@@ -185,6 +185,10 @@
         remove the check code of the execution interval in the task that has
         been scheduled. (kfujino)
       </fix>
+      <fix>
+        <bug>59850</bug>: Ensure that the <code>ResultSet</code>
is closed when
+        enabling the <code>StatementCache</code> interceptor. (kfujino)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Other">



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


Mime
View raw message