mirror of https://github.com/apache/activemq.git
ensure embedded jdbc is shutdown
This commit is contained in:
parent
81b8403f33
commit
bcdf770c10
|
@ -80,6 +80,7 @@ abstract public class DataSourceServiceSupport extends LockableServiceSupport {
|
||||||
public void closeDataSource(DataSource dataSource) {
|
public void closeDataSource(DataSource dataSource) {
|
||||||
if (createdDefaultDataSource != null && createdDefaultDataSource.equals(dataSource)) {
|
if (createdDefaultDataSource != null && createdDefaultDataSource.equals(dataSource)) {
|
||||||
shutdownDefaultDataSource(dataSource);
|
shutdownDefaultDataSource(dataSource);
|
||||||
|
createdDefaultDataSource = this.dataSource = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,6 @@ import org.apache.activemq.command.MessageAck;
|
||||||
import org.apache.activemq.command.ProducerInfo;
|
import org.apache.activemq.command.ProducerInfo;
|
||||||
import org.apache.activemq.command.SessionInfo;
|
import org.apache.activemq.command.SessionInfo;
|
||||||
import org.apache.activemq.command.XATransactionId;
|
import org.apache.activemq.command.XATransactionId;
|
||||||
import org.apache.activemq.openwire.OpenWireFormat;
|
|
||||||
import org.apache.activemq.store.PersistenceAdapter;
|
import org.apache.activemq.store.PersistenceAdapter;
|
||||||
import org.apache.activemq.store.jdbc.JDBCPersistenceAdapter;
|
import org.apache.activemq.store.jdbc.JDBCPersistenceAdapter;
|
||||||
import org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter;
|
import org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter;
|
||||||
|
@ -66,7 +65,7 @@ public class AMQ5567Test extends BrokerRestartTestSupport {
|
||||||
PersistenceAdapter[] persistenceAdapters = new PersistenceAdapter[]{
|
PersistenceAdapter[] persistenceAdapters = new PersistenceAdapter[]{
|
||||||
new KahaDBPersistenceAdapter(),
|
new KahaDBPersistenceAdapter(),
|
||||||
new LevelDBPersistenceAdapter(),
|
new LevelDBPersistenceAdapter(),
|
||||||
new JDBCPersistenceAdapter(JDBCPersistenceAdapter.createDataSource(IOHelper.getDefaultDataDirectory()), new OpenWireFormat())
|
new JDBCPersistenceAdapter()
|
||||||
};
|
};
|
||||||
for (PersistenceAdapter adapter : persistenceAdapters) {
|
for (PersistenceAdapter adapter : persistenceAdapters) {
|
||||||
adapter.setDirectory(new File(IOHelper.getDefaultDataDirectory()));
|
adapter.setDirectory(new File(IOHelper.getDefaultDataDirectory()));
|
||||||
|
@ -134,7 +133,7 @@ public class AMQ5567Test extends BrokerRestartTestSupport {
|
||||||
PersistenceAdapter[] persistenceAdapters = new PersistenceAdapter[]{
|
PersistenceAdapter[] persistenceAdapters = new PersistenceAdapter[]{
|
||||||
new KahaDBPersistenceAdapter(),
|
new KahaDBPersistenceAdapter(),
|
||||||
new LevelDBPersistenceAdapter(),
|
new LevelDBPersistenceAdapter(),
|
||||||
new JDBCPersistenceAdapter(JDBCPersistenceAdapter.createDataSource(IOHelper.getDefaultDataDirectory()), new OpenWireFormat())
|
new JDBCPersistenceAdapter()
|
||||||
};
|
};
|
||||||
for (PersistenceAdapter adapter : persistenceAdapters) {
|
for (PersistenceAdapter adapter : persistenceAdapters) {
|
||||||
adapter.setDirectory(new File(IOHelper.getDefaultDataDirectory()));
|
adapter.setDirectory(new File(IOHelper.getDefaultDataDirectory()));
|
||||||
|
|
Loading…
Reference in New Issue