You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2012/05/10 15:12:13 UTC

svn commit: r1336663 - in /incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core: database/DBInterfaceDerby.java database/DBInterfacePostgreSQL.java jdbcpool/ConnectionPool.java jdbcpool/ConnectionPoolManager.java

Author: kwright
Date: Thu May 10 13:12:12 2012
New Revision: 1336663

URL: http://svn.apache.org/viewvc?rev=1336663&view=rev
Log:
Get pool working (shutdown still doesn't work)

Modified:
    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/DBInterfacePostgreSQL.java
    incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/jdbcpool/ConnectionPool.java
    incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/jdbcpool/ConnectionPoolManager.java

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=1336663&r1=1336662&r2=1336663&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 13:12:12 2012
@@ -1388,7 +1388,7 @@ public class DBInterfaceDerby extends Da
     case TRANSACTION_READCOMMITTED:
       try
       {
-        executeViaThread(connection.getConnection(),"SET ISOLATION READ COMMITTED",null,false,0,null,null);
+        executeViaThread((connection==null)?null: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.getConnection(),"SET ISOLATION SERIALIZABLE",null,false,0,null,null);
+        executeViaThread((connection==null)?null:connection.getConnection(),"SET ISOLATION SERIALIZABLE",null,false,0,null,null);
       }
       catch (Error 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=1336663&r1=1336662&r2=1336663&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 13:12:12 2012
@@ -1148,7 +1148,7 @@ public class DBInterfacePostgreSQL exten
   {
     try
     {
-      executeViaThread(connection.getConnection(),"START TRANSACTION",null,false,0,null,null);
+      executeViaThread((connection==null)?null:connection.getConnection(),"START TRANSACTION",null,false,0,null,null);
     }
     catch (ManifoldCFException e)
     {
@@ -1162,7 +1162,7 @@ public class DBInterfacePostgreSQL exten
   {
     try
     {
-      executeViaThread(connection.getConnection(),"COMMIT",null,false,0,null,null);
+      executeViaThread((connection==null)?null:connection.getConnection(),"COMMIT",null,false,0,null,null);
     }
     catch (ManifoldCFException e)
     {
@@ -1177,7 +1177,7 @@ public class DBInterfacePostgreSQL exten
   {
     try
     {
-      executeViaThread(connection.getConnection(),"ROLLBACK",null,false,0,null,null);
+      executeViaThread((connection==null)?null: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=1336663&r1=1336662&r2=1336663&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 13:12:12 2012
@@ -60,7 +60,6 @@ public class ConnectionPool
   public WrappedConnection getConnection()
     throws SQLException, InterruptedException
   {
-    System.out.println("getConnection()");
     while (true)
     {
       synchronized (this)
@@ -82,18 +81,15 @@ 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
     {

Modified: incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/jdbcpool/ConnectionPoolManager.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/jdbcpool/ConnectionPoolManager.java?rev=1336663&r1=1336662&r2=1336663&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/jdbcpool/ConnectionPoolManager.java (original)
+++ incubator/lcf/branches/CONNECTORS-96/framework/core/src/main/java/org/apache/manifoldcf/core/jdbcpool/ConnectionPoolManager.java Thu May 10 13:12:12 2012
@@ -53,9 +53,7 @@ public class ConnectionPoolManager
     String userName, String password, int maxSize, long expiration)
     throws ClassNotFoundException, InstantiationException, IllegalAccessException
   {
-    System.out.println("Instantiating");
     Class.forName(driverClassName).newInstance();
-    System.out.println("Instantiated");
     ConnectionPool cp = new ConnectionPool(dbURL,userName,password,maxSize,expiration);
     poolMap.put(poolKey,cp);
     return cp;