https://issues.apache.org/bugzilla/show_bug.cgi?id=51185
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 20 May 2011 22:03:39 +0000 (22:03 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 20 May 2011 22:03:39 +0000 (22:03 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1125573 13f79535-47bb-0310-9956-ffa450edef68

modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/DataSourceProxy.java

index 225d07a..2280552 100644 (file)
@@ -92,7 +92,20 @@ public class DataSourceProxy implements PoolConfiguration {
      * @return Driver
      * @throws SQLException
      */
-    public synchronized ConnectionPool createPool() throws SQLException {
+    public ConnectionPool createPool() throws SQLException {
+        if (pool != null) {
+            return pool;
+        } else {
+            return pCreatePool();
+        }
+    }
+    
+    /**
+     * Sets up the connection pool, by creating a pooling driver.
+     * @return Driver
+     * @throws SQLException
+     */
+    private synchronized ConnectionPool pCreatePool() throws SQLException {
         if (pool != null) {
             return pool;
         } else {