jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r631379 - in /jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence: bundle/OraclePersistenceManager.java bundle/util/ConnectionRecoveryManager.java db/DatabasePersistenceManager.java
Date Tue, 26 Feb 2008 21:05:39 GMT
Author: jukka
Date: Tue Feb 26 13:05:36 2008
New Revision: 631379

URL: http://svn.apache.org/viewvc?rev=631379&view=rev
Log:
1.3: Merged revision 573272 (JCR-1116), adapted to modifications from JCR-940

Modified:
    jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/OraclePersistenceManager.java
    jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ConnectionRecoveryManager.java
    jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/DatabasePersistenceManager.java

Modified: jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/OraclePersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/OraclePersistenceManager.java?rev=631379&r1=631378&r2=631379&view=diff
==============================================================================
--- jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/OraclePersistenceManager.java
(original)
+++ jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/OraclePersistenceManager.java
Tue Feb 26 13:05:36 2008
@@ -22,6 +22,8 @@
 import org.apache.jackrabbit.core.persistence.PMContext;
 import org.apache.jackrabbit.core.persistence.bundle.util.DbNameIndex;
 import org.apache.jackrabbit.core.persistence.bundle.util.NGKDbNameIndex;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Extends the {@link BundleDbPersistenceManager} by Oracle specific code.
@@ -47,6 +49,11 @@
     static final String CVS_ID = "$URL$ $Rev$ $Date$";
 
     /**
+     * the default logger
+     */
+    private static Logger log = LoggerFactory.getLogger(OraclePersistenceManager.class);
+
+    /**
      * Creates a new oracle persistence manager
      */
     public OraclePersistenceManager() {
@@ -76,19 +83,21 @@
         }
         super.init(context);
 
-/*
         // check driver version
-        DatabaseMetaData metaData =
-            connectionManager.getConnection().getMetaData();
-        if (metaData.getDriverMajorVersion() < 10) {
-            // oracle drivers prior to version 10 only support
-            // writing BLOBs up to 32k in size...
-            log.warn("unsupported driver version detected: "
-                    + metaData.getDriverName()
-                    + " v" + metaData.getDriverVersion());
-        }
-*/
+        try {
+            DatabaseMetaData metaData =
+                connectionManager.getConnection().getMetaData();
+            if (metaData.getDriverMajorVersion() < 10) {
+                // Oracle drivers prior to version 10 only support
+                // writing BLOBs up to 32k in size...
+                log.warn("Unsupported driver version detected: "
+                        + metaData.getDriverName()
+                        + " v" + metaData.getDriverVersion());
+            }
+        } catch (SQLException e) {
+            log.warn("Can not retrieve driver version", e);
         }
+    }
 
     /**
      * Retruns a new instance of a NGKDbNameIndex.

Modified: jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ConnectionRecoveryManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ConnectionRecoveryManager.java?rev=631379&r1=631378&r2=631379&view=diff
==============================================================================
--- jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ConnectionRecoveryManager.java
(original)
+++ jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ConnectionRecoveryManager.java
Tue Feb 26 13:05:36 2008
@@ -18,6 +18,7 @@
 
 import java.io.InputStream;
 import java.sql.Connection;
+import java.sql.DatabaseMetaData;
 import java.sql.DriverManager;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
@@ -329,6 +330,13 @@
             throw e;
         }
         connection.setAutoCommit(true);
+        try {
+            DatabaseMetaData meta = connection.getMetaData();
+            log.info("Database: " + meta.getDatabaseProductName() + " / " + meta.getDatabaseProductVersion());
+            log.info("Driver: " + meta.getDriverName() + " / " + meta.getDriverVersion());
+        } catch (SQLException e) {
+            log.warn("Can not retrieve database and driver name / version", e);
+        }
     }
 
     /**

Modified: jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/DatabasePersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/DatabasePersistenceManager.java?rev=631379&r1=631378&r2=631379&view=diff
==============================================================================
--- jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/DatabasePersistenceManager.java
(original)
+++ jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/DatabasePersistenceManager.java
Tue Feb 26 13:05:36 2008
@@ -195,6 +195,14 @@
         // setup jdbc connection
         initConnection();
 
+        DatabaseMetaData meta = con.getMetaData();
+        try {
+            log.info("Database: " + meta.getDatabaseProductName() + " / " + meta.getDatabaseProductVersion());
+            log.info("Driver: " + meta.getDriverName() + " / " + meta.getDriverVersion());
+        } catch (SQLException e) {
+            log.warn("Can not retrieve database and driver name / version", e);
+        }
+
         // make sure schemaObjectPrefix consists of legal name characters only
         prepareSchemaObjectPrefix();
 
@@ -237,7 +245,7 @@
 
         try {
             // close shared prepared statements
-            for (Iterator it = preparedStatements.values().iterator(); it.hasNext(); ) {
+            for (Iterator it = preparedStatements.values().iterator(); it.hasNext();) {
                 closeStatement((PreparedStatement) it.next());
             }
             preparedStatements.clear();
@@ -777,7 +785,7 @@
         // gracefully in order to avoid potential memory leaks
 
         // close shared prepared statements
-        for (Iterator it = preparedStatements.values().iterator(); it.hasNext(); ) {
+        for (Iterator it = preparedStatements.values().iterator(); it.hasNext();) {
             PreparedStatement stmt = ((PreparedStatement) it.next());
             if (stmt != null) {
                 try {
@@ -1160,12 +1168,12 @@
             return super.skip(n);
         }
 
-        public int read(byte b[]) throws IOException {
+        public int read(byte[] b) throws IOException {
             consumed = true;
             return super.read(b);
         }
 
-        public int read(byte b[], int off, int len) throws IOException {
+        public int read(byte[] b, int off, int len) throws IOException {
             consumed = true;
             return super.read(b, off, len);
         }



Mime
View raw message