jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r658583 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core: fs/db/DerbyFileSystem.java persistence/db/DerbyPersistenceManager.java
Date Wed, 21 May 2008 08:06:52 GMT
Author: stefan
Date: Wed May 21 01:06:52 2008
New Revision: 658583

URL: http://svn.apache.org/viewvc?rev=658583&view=rev
Log:
JCR-1557: Avoid exceptions during shutting repository down if several PMs/FSs use same DB

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/DerbyFileSystem.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/DerbyPersistenceManager.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/DerbyFileSystem.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/DerbyFileSystem.java?rev=658583&r1=658582&r2=658583&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/DerbyFileSystem.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/DerbyFileSystem.java
Wed May 21 01:06:52 2008
@@ -98,7 +98,16 @@
      */
     protected void closeConnection(Connection connection) throws SQLException {
         // prepare connection url for issuing shutdown command
-        String url = connection.getMetaData().getURL();
+        String url;
+        try {
+            url = connection.getMetaData().getURL();
+        } catch (SQLException e) {
+            // JCR-1557: embedded derby db probably already shut down;
+            // this happens when configuring multiple FS/PM instances
+            // to use the same embedded derby db instance.
+            log.debug("failed to retrieve connection url: embedded db probably already shut
down", e);
+            return;
+        }
         int pos = url.lastIndexOf(';');
         if (pos != -1) {
             // strip any attributes from connection url

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/DerbyPersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/DerbyPersistenceManager.java?rev=658583&r1=658582&r2=658583&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/DerbyPersistenceManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/DerbyPersistenceManager.java
Wed May 21 01:06:52 2008
@@ -106,7 +106,16 @@
      */
     protected void closeConnection(Connection connection) throws SQLException {
         // prepare connection url for issuing shutdown command
-        String url = connection.getMetaData().getURL();
+        String url;
+        try {
+            url = connection.getMetaData().getURL();
+        } catch (SQLException e) {
+            // JCR-1557: embedded derby db probably already shut down;
+            // this happens when configuring multiple FS/PM instances
+            // to use the same embedded derby db instance.
+            log.debug("failed to retrieve connection url: embedded db probably already shut
down", e);
+            return;
+        }
         int pos = url.lastIndexOf(';');
         if (pos != -1) {
             // strip any attributes from connection url



Mime
View raw message