From 2872aed36a931f33fb47c101b00467e6a03cc400 Mon Sep 17 00:00:00 2001 From: Robert Gemmell Date: Thu, 10 Jun 2010 09:05:03 +0000 Subject: 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 git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@953254 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/qpid/server/store/DerbyMessageStore.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'java/broker/src') diff --git a/java/broker/src/main/java/org/apache/qpid/server/store/DerbyMessageStore.java b/java/broker/src/main/java/org/apache/qpid/server/store/DerbyMessageStore.java index aeec8798d5..bea4648b30 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/store/DerbyMessageStore.java +++ b/java/broker/src/main/java/org/apache/qpid/server/store/DerbyMessageStore.java @@ -218,8 +218,9 @@ public class DerbyMessageStore implements MessageStore { 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 implements MessageStore 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 implements MessageStore } } - 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(); -- cgit v1.2.1