You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2010/06/10 11:05:03 UTC

svn commit: r953254 - /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DerbyMessageStore.java

Author: robbie
Date: Thu Jun 10 09:05:03 2010
New Revision: 953254

URL: http://svn.apache.org/viewvc?rev=953254&view=rev
Log:
QPID-2650: revert change in r952930 which removed the extraneous vhost subdir. A slightly larger change is required as it turns out derby wont use a provided empty directory

Modified:
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DerbyMessageStore.java

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DerbyMessageStore.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DerbyMessageStore.java?rev=953254&r1=953253&r2=953254&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DerbyMessageStore.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DerbyMessageStore.java Thu Jun 10 09:05:03 2010
@@ -218,8 +218,9 @@ public class DerbyMessageStore implement
     {
         initialiseDriver();
 
-        final String databasePath = storeConfiguration.getString(ENVIRONMENT_PATH_PROPERTY, 
-                                            System.getProperty("QPID_WORK")+"/derbyDB/" + name);
+        //Update to pick up QPID_WORK and use that as the default location not just derbyDB
+
+        final String databasePath = storeConfiguration.getString(ENVIRONMENT_PATH_PROPERTY, System.getProperty("QPID_WORK")+"/derbyDB");
 
         File environmentPath = new File(databasePath);
         if (!environmentPath.exists())
@@ -233,7 +234,7 @@ public class DerbyMessageStore implement
 
         CurrentActor.get().message(_logSubject, MessageStoreMessages.MST_STORE_LOCATION(environmentPath.getAbsolutePath()));
 
-        createOrOpenDatabase(databasePath);
+        createOrOpenDatabase(name, databasePath);
     }
 
     private static synchronized void initialiseDriver() throws ClassNotFoundException
@@ -244,9 +245,10 @@ public class DerbyMessageStore implement
         }
     }
 
-    private void createOrOpenDatabase(final String environmentPath) throws SQLException
+    private void createOrOpenDatabase(String name, final String environmentPath) throws SQLException
     {
-        _connectionURL = "jdbc:derby:" + environmentPath + ";create=true";
+        //FIXME this the _vhost name should not be added here, but derby wont use an empty directory as was possibly just created.
+        _connectionURL = "jdbc:derby:" + environmentPath + "/" + name + ";create=true";
 
         Connection conn = newAutoCommitConnection();
 



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org