jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marti...@apache.org
Subject svn commit: r810433 - in /jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core: fs/db/MSSqlFileSystem.java fs/db/OracleFileSystem.java util/db/ConnectionFactory.java
Date Wed, 02 Sep 2009 09:33:33 GMT
Author: martijnh
Date: Wed Sep  2 09:33:31 2009
New Revision: 810433

URL: http://svn.apache.org/viewvc?rev=810433&view=rev
Log:
JCR-1456 Database connection pooling

* Small fixes.

Modified:
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/MSSqlFileSystem.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/OracleFileSystem.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionFactory.java

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/MSSqlFileSystem.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/MSSqlFileSystem.java?rev=810433&r1=810432&r2=810433&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/MSSqlFileSystem.java
(original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/MSSqlFileSystem.java
Wed Sep  2 09:33:31 2009
@@ -55,7 +55,7 @@
     public static final String TABLE_SPACE_VARIABLE = "${tableSpace}";
 
     /** the MS SQL table space to use */
-    protected String tableSpace;
+    protected String tableSpace = "";
 
     /**
      * Returns the configured MS SQL table space.
@@ -84,9 +84,6 @@
         // preset some attributes to reasonable defaults
         schema = "mssql";
         driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-        schemaObjectPrefix = "";
-        tableSpace = "";
-        initialized = false;
     }
 
     /**

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/OracleFileSystem.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/OracleFileSystem.java?rev=810433&r1=810432&r2=810433&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/OracleFileSystem.java
(original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/OracleFileSystem.java
Wed Sep  2 09:33:31 2009
@@ -56,7 +56,7 @@
 public class OracleFileSystem extends DbFileSystem {
 
     /** the Oracle table space to use */
-    protected String tableSpace;
+    protected String tableSpace = "";
 
     /**
      * Creates a new <code>OracleFileSystem</code> instance.

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionFactory.java?rev=810433&r1=810432&r2=810433&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionFactory.java
(original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionFactory.java
Wed Sep  2 09:33:31 2009
@@ -98,17 +98,14 @@
      * 
      * This method actually assumes that we are using commons DBCP 1.2.2.
      * 
-     * @param con the commons-DBCP pooled connection to unwrap
+     * @param con the commons-DBCP {@code PoolableConnection} to unwrap
      * @return the unwrapped connection
      */
     public static Connection unwrap(Connection con) throws SQLException {
         try {
-            Field f1 = con.getClass().getDeclaredField("delegate");
-            f1.setAccessible(true);
-            Object con2 = f1.get(con);
-            Field f2 = DelegatingConnection.class.getDeclaredField("_conn");
-            f2.setAccessible(true);
-            return (Connection) f2.get(con2);
+            Field f = DelegatingConnection.class.getDeclaredField("_conn");
+            f.setAccessible(true);
+            return (Connection) f.get(con);
         } catch (IllegalArgumentException e) {
             throw new SQLException("failed to unwrap connection: " + e.getMessage());
         } catch (NoSuchFieldException e) {



Mime
View raw message