Connection c = xac.getConnection(); c.close();
PooledConnection xac = ((ConnectionPoolDataSource) pool).getPooledConnection();
    public void testConnectionInLoop() throws Exception {        PooledConnection xac = ((ConnectionPoolDataSource) pool).getPooledConnection();                try {            Connection c = xac.getConnection();             c.close();                        try {                Connection c2 = xac.getConnection();                c2.close();                fail("Should not obtain logical connection.");            } catch(SQLException ex) {                // everything is fine            }        } finally {                    xac.close();        }    }