tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kkoli...@apache.org
Subject svn commit: r1348056 - /tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java
Date Fri, 08 Jun 2012 13:08:14 GMT
Author: kkolinko
Date: Fri Jun  8 13:08:14 2012
New Revision: 1348056

URL: http://svn.apache.org/viewvc?rev=1348056&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53374
Fix support for the following properties in DataSourceFactory:
commitOnReturn
rollbackOnReturn
useDisposableConnectionFacade
logValidationErrors
propagateInterruptState

I compared fields in PoolProperties and properties processed by DataSourceFactory,
and these 5 recently added ones were missing.
Based on patch proposed by Suresh Avadhanula.

Modified:
    tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java

Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java?rev=1348056&r1=1348055&r2=1348056&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java
(original)
+++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java
Fri Jun  8 13:08:14 2012
@@ -113,6 +113,14 @@ public class DataSourceFactory implement
 
     protected static final String PROP_ALTERNATE_USERNAME_ALLOWED = "alternateUsernameAllowed";
 
+    protected static final String PROP_COMMITONRETURN = "commitOnReturn";
+    protected static final String PROP_ROLLBACKONRETURN = "rollbackOnReturn";
+
+    protected static final String PROP_USEDISPOSABLECONNECTIONFACADE = "useDisposableConnectionFacade";
+
+    protected static final String PROP_LOGVALIDATIONERRORS = "logValidationErrors";
+
+    protected static final String PROP_PROPAGATEINTERRUPTSTATE = "propagateInterruptState";
 
     public static final int UNKNOWN_TRANSACTIONISOLATION = -1;
 
@@ -162,7 +170,12 @@ public class DataSourceFactory implement
         PROP_DATASOURCE,
         PROP_DATASOURCE_JNDI,
         PROP_SUSPECT_TIMEOUT,
-        PROP_ALTERNATE_USERNAME_ALLOWED
+        PROP_ALTERNATE_USERNAME_ALLOWED,
+        PROP_COMMITONRETURN,
+        PROP_ROLLBACKONRETURN,
+        PROP_USEDISPOSABLECONNECTIONFACADE,
+        PROP_LOGVALIDATIONERRORS,
+        PROP_PROPAGATEINTERRUPTSTATE
     };
 
     // -------------------------------------------------- ObjectFactory Methods
@@ -476,6 +489,31 @@ public class DataSourceFactory implement
             poolProperties.setAlternateUsernameAllowed(Boolean.parseBoolean(value));
         }
 
+        value = properties.getProperty(PROP_COMMITONRETURN);
+        if (value != null) {
+            poolProperties.setCommitOnReturn(Boolean.parseBoolean(value));
+        }
+
+        value = properties.getProperty(PROP_ROLLBACKONRETURN);
+        if (value != null) {
+            poolProperties.setRollbackOnReturn(Boolean.parseBoolean(value));
+        }
+
+        value = properties.getProperty(PROP_USEDISPOSABLECONNECTIONFACADE);
+        if (value != null) {
+            poolProperties.setUseDisposableConnectionFacade(Boolean.parseBoolean(value));
+        }
+
+        value = properties.getProperty(PROP_LOGVALIDATIONERRORS);
+        if (value != null) {
+            poolProperties.setLogValidationErrors(Boolean.parseBoolean(value));
+        }
+
+        value = properties.getProperty(PROP_PROPAGATEINTERRUPTSTATE);
+        if (value != null) {
+            poolProperties.setPropagateInterruptState(Boolean.parseBoolean(value));
+        }
+
         return poolProperties;
     }
 



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


Mime
View raw message