]> source.dussan.org Git - vaadin-framework.git/commitdiff
Make TableQuery only release connections reserved through its pool (#12370)
authorArtur Signell <artur@vaadin.com>
Fri, 15 May 2015 14:50:51 +0000 (17:50 +0300)
committerVaadin Code Review <review@vaadin.com>
Mon, 18 May 2015 12:03:47 +0000 (12:03 +0000)
Updated all SQLContainer tests to track that connection are correctly
reserved and released

Change-Id: I3f12527683a19d44a2db265491b6ba9331c0980b

server/src/com/vaadin/data/util/sqlcontainer/query/TableQuery.java
server/tests/src/com/vaadin/data/util/sqlcontainer/SQLContainerTableQueryTest.java
server/tests/src/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java
server/tests/src/com/vaadin/data/util/sqlcontainer/TicketTests.java
server/tests/src/com/vaadin/data/util/sqlcontainer/connection/SimpleJDBCConnectionPoolTest.java
server/tests/src/com/vaadin/data/util/sqlcontainer/generator/SQLGeneratorsTest.java
server/tests/src/com/vaadin/data/util/sqlcontainer/query/FreeformQueryTest.java
server/tests/src/com/vaadin/data/util/sqlcontainer/query/TableQueryTest.java
server/tests/src/com/vaadin/data/util/sqlcontainer/query/ValidatingSimpleJDBCConnectionPool.java [new file with mode: 0644]

index bb000bd8f5b38ca7ad825fca708fe75e9f89d5d8..9a41766a3180d5075dc71d4f23c48cc558e49b61 100644 (file)
@@ -213,8 +213,8 @@ public class TableQuery extends AbstractTransactionalQuery implements
         } finally {
             try {
                 if (r != null) {
-                    releaseConnection(r.getStatement().getConnection(),
-                            r.getStatement(), r);
+                    // Do not release connection, it is done in commit()
+                    releaseConnection(null, r.getStatement(), r);
                 }
             } finally {
                 if (shouldCloseTransaction) {
@@ -774,8 +774,8 @@ public class TableQuery extends AbstractTransactionalQuery implements
         } finally {
             try {
                 if (rs != null) {
-                    releaseConnection(rs.getStatement().getConnection(),
-                            rs.getStatement(), rs);
+                    // Do not release connection, it is done in commit()
+                    releaseConnection(null, rs.getStatement(), rs);
                 }
             } finally {
                 if (shouldCloseTransaction) {
index c70462012e3ad9d3d992dd916f7df466e08db1b4..92d0c49205c2addf52bb19d4fd97d2d10579feec 100644 (file)
@@ -29,9 +29,9 @@ import com.vaadin.data.Item;
 import com.vaadin.data.util.filter.Like;
 import com.vaadin.data.util.sqlcontainer.SQLTestsConstants.DB;
 import com.vaadin.data.util.sqlcontainer.connection.JDBCConnectionPool;
-import com.vaadin.data.util.sqlcontainer.connection.SimpleJDBCConnectionPool;
 import com.vaadin.data.util.sqlcontainer.query.OrderBy;
 import com.vaadin.data.util.sqlcontainer.query.TableQuery;
+import com.vaadin.data.util.sqlcontainer.query.ValidatingSimpleJDBCConnectionPool;
 
 public class SQLContainerTableQueryTest {
 
@@ -51,7 +51,7 @@ public class SQLContainerTableQueryTest {
     public void setUp() throws SQLException {
 
         try {
-            connectionPool = new SimpleJDBCConnectionPool(
+            connectionPool = new ValidatingSimpleJDBCConnectionPool(
                     SQLTestsConstants.dbDriver, SQLTestsConstants.dbURL,
                     SQLTestsConstants.dbUser, SQLTestsConstants.dbPwd, 2, 2);
         } catch (SQLException e) {
@@ -99,14 +99,23 @@ public class SQLContainerTableQueryTest {
         assertTrue(container.removeItem(container.lastItemId()));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void itemWithNonExistingVersionColumnCannotBeRemoved()
             throws SQLException {
         query.setVersionColumn("version");
 
         container.removeItem(container.lastItemId());
 
-        container.commit();
+        // FIXME Remove try-catch when https://dev.vaadin.com/ticket/17858 is
+        // fixed
+        try {
+            container.commit();
+            Assert.fail("Commit should not succeed when version column does not exist");
+        } catch (IllegalArgumentException e) {
+            // This should not be here at all as commit() should not leave the
+            // transaction open!
+            container.getQueryDelegate().rollback();
+        }
     }
 
     @Test
index 4c132eba30cb99f7b046c48405bfc3a0c9c6c1ff..a332d9d9ee71e30876f485f269b74092bc8fb0c8 100644 (file)
@@ -26,11 +26,11 @@ import com.vaadin.data.util.filter.Compare.Equal;
 import com.vaadin.data.util.filter.Like;
 import com.vaadin.data.util.sqlcontainer.SQLTestsConstants.DB;
 import com.vaadin.data.util.sqlcontainer.connection.JDBCConnectionPool;
-import com.vaadin.data.util.sqlcontainer.connection.SimpleJDBCConnectionPool;
 import com.vaadin.data.util.sqlcontainer.query.FreeformQuery;
 import com.vaadin.data.util.sqlcontainer.query.FreeformQueryDelegate;
 import com.vaadin.data.util.sqlcontainer.query.FreeformStatementDelegate;
 import com.vaadin.data.util.sqlcontainer.query.OrderBy;
+import com.vaadin.data.util.sqlcontainer.query.ValidatingSimpleJDBCConnectionPool;
 import com.vaadin.data.util.sqlcontainer.query.generator.MSSQLGenerator;
 import com.vaadin.data.util.sqlcontainer.query.generator.OracleGenerator;
 import com.vaadin.data.util.sqlcontainer.query.generator.SQLGenerator;
@@ -45,7 +45,7 @@ public class SQLContainerTest {
     public void setUp() throws SQLException {
 
         try {
-            connectionPool = new SimpleJDBCConnectionPool(
+            connectionPool = new ValidatingSimpleJDBCConnectionPool(
                     SQLTestsConstants.dbDriver, SQLTestsConstants.dbURL,
                     SQLTestsConstants.dbUser, SQLTestsConstants.dbPwd, 2, 2);
         } catch (SQLException e) {
index 110225e206c429411ce7ac3670129d62de57a63c..e180e3f3e797f3e446334a10e40ebcfbdd93561f 100644 (file)
@@ -16,10 +16,11 @@ import com.vaadin.data.Container.Filter;
 import com.vaadin.data.Item;
 import com.vaadin.data.util.filter.Compare.Equal;
 import com.vaadin.data.util.sqlcontainer.SQLTestsConstants.DB;
-import com.vaadin.data.util.sqlcontainer.connection.SimpleJDBCConnectionPool;
+import com.vaadin.data.util.sqlcontainer.connection.JDBCConnectionPool;
 import com.vaadin.data.util.sqlcontainer.query.FreeformQuery;
 import com.vaadin.data.util.sqlcontainer.query.FreeformStatementDelegate;
 import com.vaadin.data.util.sqlcontainer.query.TableQuery;
+import com.vaadin.data.util.sqlcontainer.query.ValidatingSimpleJDBCConnectionPool;
 import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper;
 import com.vaadin.data.util.sqlcontainer.query.generator.filter.QueryBuilder;
 import com.vaadin.ui.Table;
@@ -27,11 +28,11 @@ import com.vaadin.ui.Window;
 
 public class TicketTests {
 
-    private SimpleJDBCConnectionPool connectionPool;
+    private JDBCConnectionPool connectionPool;
 
     @Before
     public void setUp() throws SQLException {
-        connectionPool = new SimpleJDBCConnectionPool(
+        connectionPool = new ValidatingSimpleJDBCConnectionPool(
                 SQLTestsConstants.dbDriver, SQLTestsConstants.dbURL,
                 SQLTestsConstants.dbUser, SQLTestsConstants.dbPwd, 2, 2);
         DataGenerator.addPeopleToDatabase(connectionPool);
index 99ad420229c4e347fe7fde803603d6d8aa0524d4..b786f5b2de0f9ca9e701de2938886adacf83f048 100644 (file)
@@ -9,13 +9,14 @@ import org.junit.Before;
 import org.junit.Test;
 
 import com.vaadin.data.util.sqlcontainer.SQLTestsConstants;
+import com.vaadin.data.util.sqlcontainer.query.ValidatingSimpleJDBCConnectionPool;
 
 public class SimpleJDBCConnectionPoolTest {
     private JDBCConnectionPool connectionPool;
 
     @Before
     public void setUp() throws SQLException {
-        connectionPool = new SimpleJDBCConnectionPool(
+        connectionPool = new ValidatingSimpleJDBCConnectionPool(
                 SQLTestsConstants.dbDriver, SQLTestsConstants.dbURL,
                 SQLTestsConstants.dbUser, SQLTestsConstants.dbPwd, 2, 2);
     }
@@ -145,8 +146,11 @@ public class SimpleJDBCConnectionPoolTest {
         EasyMock.expectLastCall().atLeastOnce();
         EasyMock.replay(c);
         // make sure the connection pool is initialized
-        connectionPool.reserveConnection();
-        connectionPool.releaseConnection(c);
+        // Bypass validation
+        JDBCConnectionPool realPool = ((ValidatingSimpleJDBCConnectionPool) connectionPool)
+                .getRealPool();
+        realPool.reserveConnection();
+        realPool.releaseConnection(c);
         EasyMock.verify(c);
     }
 
@@ -154,7 +158,13 @@ public class SimpleJDBCConnectionPoolTest {
     public void destroy_shouldCloseAllConnections() throws SQLException {
         Connection c1 = connectionPool.reserveConnection();
         Connection c2 = connectionPool.reserveConnection();
-        connectionPool.destroy();
+        try {
+            connectionPool.destroy();
+        } catch (RuntimeException e) {
+            // The test connection pool throws an exception when the pool was
+            // not empty but only after cleanup of the real pool has been done
+        }
+
         Assert.assertTrue(c1.isClosed());
         Assert.assertTrue(c2.isClosed());
     }
index 59e879a8e0492bfd3aa8f23d741cab6ab35d21e0..c2dbf0f12a237057ddd8251860c5d9061c6a22ed 100644 (file)
@@ -18,9 +18,9 @@ import com.vaadin.data.util.sqlcontainer.RowItem;
 import com.vaadin.data.util.sqlcontainer.SQLContainer;
 import com.vaadin.data.util.sqlcontainer.SQLTestsConstants;
 import com.vaadin.data.util.sqlcontainer.connection.JDBCConnectionPool;
-import com.vaadin.data.util.sqlcontainer.connection.SimpleJDBCConnectionPool;
 import com.vaadin.data.util.sqlcontainer.query.OrderBy;
 import com.vaadin.data.util.sqlcontainer.query.TableQuery;
+import com.vaadin.data.util.sqlcontainer.query.ValidatingSimpleJDBCConnectionPool;
 import com.vaadin.data.util.sqlcontainer.query.generator.DefaultSQLGenerator;
 import com.vaadin.data.util.sqlcontainer.query.generator.MSSQLGenerator;
 import com.vaadin.data.util.sqlcontainer.query.generator.OracleGenerator;
@@ -34,7 +34,7 @@ public class SQLGeneratorsTest {
     public void setUp() throws SQLException {
 
         try {
-            connectionPool = new SimpleJDBCConnectionPool(
+            connectionPool = new ValidatingSimpleJDBCConnectionPool(
                     SQLTestsConstants.dbDriver, SQLTestsConstants.dbURL,
                     SQLTestsConstants.dbUser, SQLTestsConstants.dbPwd, 2, 2);
         } catch (SQLException e) {
index 195911475e5a893aacb5387a73899775c25f4f3d..e193b79df3e5bb44abcb6aa5116c987337961184 100644 (file)
@@ -23,7 +23,6 @@ import com.vaadin.data.util.sqlcontainer.SQLContainer;
 import com.vaadin.data.util.sqlcontainer.SQLTestsConstants;
 import com.vaadin.data.util.sqlcontainer.SQLTestsConstants.DB;
 import com.vaadin.data.util.sqlcontainer.connection.JDBCConnectionPool;
-import com.vaadin.data.util.sqlcontainer.connection.SimpleJDBCConnectionPool;
 
 public class FreeformQueryTest {
 
@@ -34,7 +33,7 @@ public class FreeformQueryTest {
     public void setUp() throws SQLException {
 
         try {
-            connectionPool = new SimpleJDBCConnectionPool(
+            connectionPool = new ValidatingSimpleJDBCConnectionPool(
                     SQLTestsConstants.dbDriver, SQLTestsConstants.dbURL,
                     SQLTestsConstants.dbUser, SQLTestsConstants.dbPwd, 2, 2);
         } catch (SQLException e) {
@@ -148,7 +147,10 @@ public class FreeformQueryTest {
                 connectionPool, "ID");
         query.getCount();
         query.getCount();
-        Assert.assertNotNull(connectionPool.reserveConnection());
+        Connection c = connectionPool.reserveConnection();
+        Assert.assertNotNull(c);
+        // Cleanup to make test connection pool happy
+        connectionPool.releaseConnection(c);
     }
 
     @Test
@@ -276,37 +278,38 @@ public class FreeformQueryTest {
                 new Object[] { 1 }), null));
     }
 
-    @Test(expected = UnsupportedOperationException.class)
+    @Test
     public void storeRow_noDelegate_shouldFail() throws SQLException {
         FreeformQuery query = new FreeformQuery("SELECT * FROM people",
                 Arrays.asList("ID"), connectionPool);
         SQLContainer container = EasyMock.createNiceMock(SQLContainer.class);
         EasyMock.replay(container);
         query.beginTransaction();
-        query.storeRow(new RowItem(container, new RowId(new Object[] { 1 }),
-                null));
-        query.commit();
-        EasyMock.verify(container);
+        try {
+            query.storeRow(new RowItem(container,
+                    new RowId(new Object[] { 1 }), null));
+            Assert.fail("storeRow should fail when there is no delegate");
+        } catch (UnsupportedOperationException e) {
+            // Cleanup to make test connection pool happy
+            query.rollback();
+        }
     }
 
-    @Test(expected = UnsupportedOperationException.class)
+    @Test
     public void removeRow_noDelegate_shouldFail() throws SQLException {
         FreeformQuery query = new FreeformQuery("SELECT * FROM people",
                 Arrays.asList("ID"), connectionPool);
         SQLContainer container = EasyMock.createNiceMock(SQLContainer.class);
         EasyMock.replay(container);
         query.beginTransaction();
-        query.removeRow(new RowItem(container, new RowId(new Object[] { 1 }),
-                null));
-        query.commit();
-        EasyMock.verify(container);
-    }
-
-    @Test
-    public void beginTransaction_readOnly_shouldSucceed() throws SQLException {
-        FreeformQuery query = new FreeformQuery("SELECT * FROM people",
-                Arrays.asList("ID"), connectionPool);
-        query.beginTransaction();
+        try {
+            query.removeRow(new RowItem(container,
+                    new RowId(new Object[] { 1 }), null));
+            Assert.fail("removeRow should fail when there is no delgate");
+        } catch (UnsupportedOperationException e) {
+            // Cleanup to make test connection pool happy
+            query.rollback();
+        }
     }
 
     @Test
@@ -628,7 +631,7 @@ public class FreeformQueryTest {
         EasyMock.verify(delegate, container);
     }
 
-    @Test(expected = UnsupportedOperationException.class)
+    @Test
     public void storeRow_delegateDoesNotImplementStoreRow_shouldFail()
             throws SQLException {
         FreeformQuery query = new FreeformQuery("SELECT * FROM people",
@@ -646,10 +649,13 @@ public class FreeformQueryTest {
         query.beginTransaction();
         RowItem row = new RowItem(container, new RowId(new Object[] { 1 }),
                 null);
-        query.storeRow(row);
-        query.commit();
-
-        EasyMock.verify(delegate, container);
+        try {
+            query.storeRow(row);
+            Assert.fail("storeRow should fail when delgate does not implement storeRow");
+        } catch (UnsupportedOperationException e) {
+            // Cleanup to make test connection pool happy
+            query.rollback();
+        }
     }
 
     @Test
@@ -675,7 +681,7 @@ public class FreeformQueryTest {
         EasyMock.verify(delegate, container);
     }
 
-    @Test(expected = UnsupportedOperationException.class)
+    @Test
     public void removeRow_delegateDoesNotImplementRemoveRow_shouldFail()
             throws SQLException {
         FreeformQuery query = new FreeformQuery("SELECT * FROM people",
@@ -693,10 +699,13 @@ public class FreeformQueryTest {
         query.beginTransaction();
         RowItem row = new RowItem(container, new RowId(new Object[] { 1 }),
                 null);
-        query.removeRow(row);
-        query.commit();
-
-        EasyMock.verify(delegate, container);
+        try {
+            query.removeRow(row);
+            Assert.fail("removeRow should fail when delegate does not implement removeRow");
+        } catch (UnsupportedOperationException e) {
+            // Cleanup to make test connection pool happy
+            query.rollback();
+        }
     }
 
     @Test
@@ -710,16 +719,24 @@ public class FreeformQueryTest {
         query.setDelegate(delegate);
 
         query.beginTransaction();
+        // Cleanup to make test connection pool happy
+        query.rollback();
     }
 
-    @Test(expected = IllegalStateException.class)
+    @Test
     public void beginTransaction_transactionAlreadyActive_shouldFail()
             throws SQLException {
         FreeformQuery query = new FreeformQuery("SELECT * FROM people",
                 Arrays.asList("ID"), connectionPool);
 
         query.beginTransaction();
-        query.beginTransaction();
+        try {
+            query.beginTransaction();
+            Assert.fail("Should throw exception when starting a transaction while already in a transaction");
+        } catch (IllegalStateException e) {
+            // Cleanup to make test connection pool happy
+            query.rollback();
+        }
     }
 
     @Test(expected = SQLException.class)
index f009fc505ec5faf627f124bd06393f3d8dd57e0c..1cb3d722c68ba08fa11e59cd49d8798fe1c0ae4c 100644 (file)
@@ -24,7 +24,6 @@ import com.vaadin.data.util.sqlcontainer.SQLContainer;
 import com.vaadin.data.util.sqlcontainer.SQLTestsConstants;
 import com.vaadin.data.util.sqlcontainer.SQLTestsConstants.DB;
 import com.vaadin.data.util.sqlcontainer.connection.JDBCConnectionPool;
-import com.vaadin.data.util.sqlcontainer.connection.SimpleJDBCConnectionPool;
 import com.vaadin.data.util.sqlcontainer.query.generator.DefaultSQLGenerator;
 
 public class TableQueryTest {
@@ -33,16 +32,14 @@ public class TableQueryTest {
 
     @Before
     public void setUp() throws SQLException {
-
         try {
-            connectionPool = new SimpleJDBCConnectionPool(
+            connectionPool = new ValidatingSimpleJDBCConnectionPool(
                     SQLTestsConstants.dbDriver, SQLTestsConstants.dbURL,
                     SQLTestsConstants.dbUser, SQLTestsConstants.dbPwd, 2, 2);
         } catch (SQLException e) {
             e.printStackTrace();
             Assert.fail(e.getMessage());
         }
-
         DataGenerator.addPeopleToDatabase(connectionPool);
     }
 
@@ -139,7 +136,9 @@ public class TableQueryTest {
                 SQLTestsConstants.sqlGen);
         tQuery.getCount();
         tQuery.getCount();
-        Assert.assertNotNull(connectionPool.reserveConnection());
+        Connection c = connectionPool.reserveConnection();
+        Assert.assertNotNull(c);
+        connectionPool.releaseConnection(c);
     }
 
     /**********************************************************************
@@ -193,20 +192,19 @@ public class TableQueryTest {
      * TableQuery transaction management tests
      **********************************************************************/
     @Test
-    public void beginTransaction_readOnly_shouldSucceed() throws SQLException {
-        TableQuery tQuery = new TableQuery("people", connectionPool,
-                SQLTestsConstants.sqlGen);
-        tQuery.beginTransaction();
-    }
-
-    @Test(expected = IllegalStateException.class)
     public void beginTransaction_transactionAlreadyActive_shouldFail()
             throws SQLException {
         TableQuery tQuery = new TableQuery("people", connectionPool,
                 SQLTestsConstants.sqlGen);
 
         tQuery.beginTransaction();
-        tQuery.beginTransaction();
+        try {
+            tQuery.beginTransaction();
+            Assert.fail("Should throw exception when starting a transaction while already in a transaction");
+        } catch (IllegalStateException e) {
+            // Cleanup to make test connection pool happy
+            tQuery.rollback();
+        }
     }
 
     @Test
@@ -284,8 +282,13 @@ public class TableQueryTest {
                     .fail("null should throw an IllegalArgumentException from StatementHelper");
         } catch (IllegalArgumentException e) {
             // We should now be able to reserve two connections
-            connectionPool.reserveConnection();
-            connectionPool.reserveConnection();
+            Connection c1 = connectionPool.reserveConnection();
+            Connection c2 = connectionPool.reserveConnection();
+
+            // Cleanup to make test connection pool happy
+            connectionPool.releaseConnection(c1);
+            connectionPool.releaseConnection(c2);
+
         }
     }
 
@@ -693,6 +696,9 @@ public class TableQueryTest {
             // cleanup - might not be an in-memory DB
             statement.execute(SQLTestsConstants.dropSchema);
         }
+
+        // Cleanup to make test connection pool happy
+        connectionPool.releaseConnection(conn);
     }
 
     @Test
diff --git a/server/tests/src/com/vaadin/data/util/sqlcontainer/query/ValidatingSimpleJDBCConnectionPool.java b/server/tests/src/com/vaadin/data/util/sqlcontainer/query/ValidatingSimpleJDBCConnectionPool.java
new file mode 100644 (file)
index 0000000..464f3c8
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.data.util.sqlcontainer.query;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Logger;
+
+import com.vaadin.data.util.sqlcontainer.connection.JDBCConnectionPool;
+import com.vaadin.data.util.sqlcontainer.connection.SimpleJDBCConnectionPool;
+
+/**
+ * Connection pool for testing SQLContainer. Ensures that only reserved
+ * connections are released and that all connections are released before the
+ * pool is destroyed.
+ * 
+ * @author Vaadin Ltd
+ */
+public class ValidatingSimpleJDBCConnectionPool implements JDBCConnectionPool {
+
+    private JDBCConnectionPool realPool;
+    private Set<Connection> reserved = new HashSet<Connection>();
+    private Set<Connection> alreadyReleased = new HashSet<Connection>();
+
+    public ValidatingSimpleJDBCConnectionPool(String driverName,
+            String connectionUri, String userName, String password,
+            int initialConnections, int maxConnections) throws SQLException {
+        realPool = new SimpleJDBCConnectionPool(driverName, connectionUri,
+                userName, password, initialConnections, maxConnections);
+    }
+
+    @Deprecated
+    public JDBCConnectionPool getRealPool() {
+        return realPool;
+    }
+
+    @Override
+    public Connection reserveConnection() throws SQLException {
+        Connection c = realPool.reserveConnection();
+        reserved.add(c);
+        return c;
+    }
+
+    @Override
+    public void releaseConnection(Connection conn) {
+        if (conn != null && !reserved.remove(conn)) {
+            if (alreadyReleased.contains(conn)) {
+                getLogger().severe(
+                        "Tried to release connection (" + conn
+                                + ") which has already been released");
+            } else {
+                throw new RuntimeException("Tried to release connection ("
+                        + conn + ") not reserved using reserveConnection");
+            }
+        }
+        realPool.releaseConnection(conn);
+        alreadyReleased.add(conn);
+
+    }
+
+    @Override
+    public void destroy() {
+        realPool.destroy();
+        if (!reserved.isEmpty()) {
+            throw new RuntimeException(reserved.size()
+                    + " connections never released");
+        }
+    }
+
+    public static Logger getLogger() {
+        return Logger.getLogger(ValidatingSimpleJDBCConnectionPool.class
+                .getName());
+    }
+}
\ No newline at end of file