Return-Path: X-Original-To: apmail-incubator-connectors-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-connectors-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 180D89187 for ; Thu, 10 May 2012 12:53:21 +0000 (UTC) Received: (qmail 83219 invoked by uid 500); 10 May 2012 12:53:21 -0000 Delivered-To: apmail-incubator-connectors-commits-archive@incubator.apache.org Received: (qmail 83179 invoked by uid 500); 10 May 2012 12:53:20 -0000 Mailing-List: contact connectors-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: connectors-dev@incubator.apache.org Delivered-To: mailing list connectors-commits@incubator.apache.org Received: (qmail 83166 invoked by uid 99); 10 May 2012 12:53:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 May 2012 12:53:20 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 May 2012 12:53:19 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 2D2C623889EC; Thu, 10 May 2012 12:52:59 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1336649 - in /incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core: database/ jdbcpool/ Date: Thu, 10 May 2012 12:52:58 -0000 To: connectors-commits@incubator.apache.org From: kwright@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120510125259.2D2C623889EC@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: kwright Date: Thu May 10 12:52:58 2012 New Revision: 1336649 URL: http://svn.apache.org/viewvc?rev=1336649&view=rev Log: Get it all to build. Modified: incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/database/ConnectionFactory.java incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceDerby.java incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceMySQL.java incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfacePostgreSQL.java incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/jdbcpool/ConnectionPool.java Modified: incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/database/ConnectionFactory.java URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/database/ConnectionFactory.java?rev=1336649&r1=1336648&r2=1336649&view=diff ============================================================================== --- incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/database/ConnectionFactory.java (original) +++ incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/database/ConnectionFactory.java Thu May 10 12:52:58 2012 @@ -93,8 +93,7 @@ public class ConnectionFactory maxDBConnections, 300000L); cp = cpm.getPool(database); } - rval = new WrappedConnection(cp, getConnectionWithRetries(database, null, null)); - return rval; + return getConnectionWithRetries(cp); } catch (Exception e) { @@ -110,13 +109,12 @@ public class ConnectionFactory public static void releaseAll() { - //??? if (poolManager != null) poolManager.releaseAll(); } - protected static Connection getConnectionWithRetries(String dbURL, String userName, String password) - throws Exception + protected static WrappedConnection getConnectionWithRetries(ConnectionPool cp) + throws SQLException, ManifoldCFException { // If we have a problem, we will wait a grand total of 30 seconds int retryCount = 3; @@ -124,20 +122,19 @@ public class ConnectionFactory { try { - Connection rval; - if (userName != null && userName.length() > 0) - rval = DriverManager.getConnection(dbURL,userName,password); - else - rval = DriverManager.getConnection(dbURL); - return rval; + return cp.getConnection(); } - catch (Exception e) + catch (SQLException e) { if (retryCount == 0) throw e; // Eat the exception and try again retryCount--; } + catch (InterruptedException e) + { + throw new ManifoldCFException("Interrupted",ManifoldCFException.INTERRUPTED); + } try { // Ten seconds is a long time Modified: incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceDerby.java URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceDerby.java?rev=1336649&r1=1336648&r2=1336649&view=diff ============================================================================== --- incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceDerby.java (original) +++ incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceDerby.java Thu May 10 12:52:58 2012 @@ -1388,7 +1388,7 @@ public class DBInterfaceDerby extends Da case TRANSACTION_READCOMMITTED: try { - executeViaThread(connection,"SET ISOLATION READ COMMITTED",null,false,0,null,null); + executeViaThread(connection.getConnection(),"SET ISOLATION READ COMMITTED",null,false,0,null,null); } catch (Error e) { @@ -1407,7 +1407,7 @@ public class DBInterfaceDerby extends Da case TRANSACTION_SERIALIZED: try { - executeViaThread(connection,"SET ISOLATION SERIALIZABLE",null,false,0,null,null); + executeViaThread(connection.getConnection(),"SET ISOLATION SERIALIZABLE",null,false,0,null,null); } catch (Error e) { @@ -1475,7 +1475,7 @@ public class DBInterfaceDerby extends Da { try { - connection.setAutoCommit(false); + connection.getConnection().setAutoCommit(false); } catch (java.sql.SQLException e) { @@ -1498,8 +1498,8 @@ public class DBInterfaceDerby extends Da { if (connection != null) { - connection.commit(); - connection.setAutoCommit(true); + connection.getConnection().commit(); + connection.getConnection().setAutoCommit(true); } } catch (java.sql.SQLException e) @@ -1526,8 +1526,8 @@ public class DBInterfaceDerby extends Da { if (connection != null) { - connection.rollback(); - connection.setAutoCommit(true); + connection.getConnection().rollback(); + connection.getConnection().setAutoCommit(true); } } catch (java.sql.SQLException e) Modified: incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java?rev=1336649&r1=1336648&r2=1336649&view=diff ============================================================================== --- incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java (original) +++ incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java Thu May 10 12:52:58 2012 @@ -1374,8 +1374,8 @@ public class DBInterfaceHSQLDB extends D { try { - connection.setAutoCommit(false); - connection.setTransactionIsolation(desiredTransactionType); + connection.getConnection().setAutoCommit(false); + connection.getConnection().setTransactionIsolation(desiredTransactionType); } catch (java.sql.SQLException e) { @@ -1398,8 +1398,8 @@ public class DBInterfaceHSQLDB extends D { if (connection != null) { - connection.commit(); - connection.setAutoCommit(true); + connection.getConnection().commit(); + connection.getConnection().setAutoCommit(true); } } catch (java.sql.SQLException e) @@ -1426,8 +1426,8 @@ public class DBInterfaceHSQLDB extends D { if (connection != null) { - connection.rollback(); - connection.setAutoCommit(true); + connection.getConnection().rollback(); + connection.getConnection().setAutoCommit(true); } } catch (java.sql.SQLException e) Modified: incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceMySQL.java URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceMySQL.java?rev=1336649&r1=1336648&r2=1336649&view=diff ============================================================================== --- incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceMySQL.java (original) +++ incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceMySQL.java Thu May 10 12:52:58 2012 @@ -1018,7 +1018,7 @@ public class DBInterfaceMySQL extends Da { try { - executeViaThread(connection,"START TRANSACTION",null,false,0,null,null); + executeViaThread(connection.getConnection(),"START TRANSACTION",null,false,0,null,null); } catch (ManifoldCFException e) { @@ -1032,7 +1032,7 @@ public class DBInterfaceMySQL extends Da { try { - executeViaThread(connection,"COMMIT",null,false,0,null,null); + executeViaThread(connection.getConnection(),"COMMIT",null,false,0,null,null); } catch (ManifoldCFException e) { @@ -1046,7 +1046,7 @@ public class DBInterfaceMySQL extends Da { try { - executeViaThread(connection,"ROLLBACK",null,false,0,null,null); + executeViaThread(connection.getConnection(),"ROLLBACK",null,false,0,null,null); } catch (ManifoldCFException e) { Modified: incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfacePostgreSQL.java URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfacePostgreSQL.java?rev=1336649&r1=1336648&r2=1336649&view=diff ============================================================================== --- incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfacePostgreSQL.java (original) +++ incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfacePostgreSQL.java Thu May 10 12:52:58 2012 @@ -1148,7 +1148,7 @@ public class DBInterfacePostgreSQL exten { try { - executeViaThread(connection,"START TRANSACTION",null,false,0,null,null); + executeViaThread(connection.getConnection(),"START TRANSACTION",null,false,0,null,null); } catch (ManifoldCFException e) { @@ -1162,7 +1162,7 @@ public class DBInterfacePostgreSQL exten { try { - executeViaThread(connection,"COMMIT",null,false,0,null,null); + executeViaThread(connection.getConnection(),"COMMIT",null,false,0,null,null); } catch (ManifoldCFException e) { @@ -1177,7 +1177,7 @@ public class DBInterfacePostgreSQL exten { try { - executeViaThread(connection,"ROLLBACK",null,false,0,null,null); + executeViaThread(connection.getConnection(),"ROLLBACK",null,false,0,null,null); } catch (ManifoldCFException e) { Modified: incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/jdbcpool/ConnectionPool.java URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/jdbcpool/ConnectionPool.java?rev=1336649&r1=1336648&r2=1336649&view=diff ============================================================================== --- incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/jdbcpool/ConnectionPool.java (original) +++ incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/jdbcpool/ConnectionPool.java Thu May 10 12:52:58 2012 @@ -60,6 +60,7 @@ public class ConnectionPool public WrappedConnection getConnection() throws SQLException, InterruptedException { + System.out.println("getConnection()"); while (true) { synchronized (this) @@ -81,15 +82,18 @@ public class ConnectionPool break; } } + System.out.println("No freed connection found"); // Create a new connection. If we fail at this we need to restore the number of active connections, so catch any failures Connection rval2 = null; try { + System.out.println("Calling DriverManage.getConnection() with '"+dbURL+"'"); if (userName != null) rval2 = DriverManager.getConnection(dbURL, userName, password); else rval2 = DriverManager.getConnection(dbURL); + System.out.println("DriverManager.getConnection() done!"); } finally {