tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kfuj...@apache.org
Subject svn commit: r1153099 - in /tomcat/trunk: java/org/apache/catalina/session/JDBCStore.java java/org/apache/catalina/session/LocalStrings.properties webapps/docs/changelog.xml
Date Tue, 02 Aug 2011 11:51:21 GMT
Author: kfujino
Date: Tue Aug  2 11:51:20 2011
New Revision: 1153099

URL: http://svn.apache.org/viewvc?rev=1153099&view=rev
Log:
Committing connection if autoCommit is false.
Make sure committed connection is returned to the pool if datasource is enabled.

Modified:
    tomcat/trunk/java/org/apache/catalina/session/JDBCStore.java
    tomcat/trunk/java/org/apache/catalina/session/LocalStrings.properties
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/session/JDBCStore.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/JDBCStore.java?rev=1153099&r1=1153098&r2=1153099&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/session/JDBCStore.java (original)
+++ tomcat/trunk/java/org/apache/catalina/session/JDBCStore.java Tue Aug  2 11:51:20 2011
@@ -1015,6 +1015,15 @@ public class JDBCStore extends StoreBase
             ExceptionUtils.handleThrowable(f);
         }
         this.preparedLoadSql = null;
+        
+        // Commit if autoCommit is false
+        try {
+            if (!dbConnection.getAutoCommit()) {
+                dbConnection.commit();
+            }            
+        } catch (SQLException e) {
+            manager.getContainer().getLogger().error(sm.getString(getStoreName() + ".commitSQLException"),
e);
+        }
 
         // Close this database connection, and log any errors
         try {

Modified: tomcat/trunk/java/org/apache/catalina/session/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/LocalStrings.properties?rev=1153099&r1=1153098&r2=1153099&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/session/LocalStrings.properties (original)
+++ tomcat/trunk/java/org/apache/catalina/session/LocalStrings.properties Tue Aug  2 11:51:20
2011
@@ -29,6 +29,7 @@ JDBCStore.checkConnectionSQLException=A 
 JDBCStore.checkConnectionClassNotFoundException=JDBC driver class not found {0}
 JDBCStore.wrongDataSource=Cannot open JNDI DataSource [{0}]
 JDBCStore.missingDataSourceName=No valid JNDI name was given.
+JDBCStore.commitSQLException=SQLException committing connection before closing
 managerBase.createRandom=Created random number generator for session ID generation in {0}ms.
 managerBase.createSession.ise=createSession: Too many active sessions
 managerBase.sessionTimeout=Invalid session timeout setting {0}

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1153099&r1=1153098&r2=1153099&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Tue Aug  2 11:51:20 2011
@@ -114,6 +114,11 @@
         of a Servlet instance always do so in way that correctly instantiates a
         Servlet instance. (markt)
       </fix>
+      <fix>
+        Committing connection if autoCommit is false.
+        Make sure committed connection is returned to the pool if datasource is 
+        enabled. (kfujino)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">



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


Mime
View raw message