diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java b/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
index a1cade9451..1e1183d2b6 100644
--- a/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
+++ b/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
@@ -510,13 +510,13 @@ public class BrokerService implements Service {
// to avoid timimg issue with discovery (spinning up a new instance)
BrokerRegistry.getInstance().unbind(getBrokerName());
VMTransportFactory.stopped(getBrokerName());
- stopper.stop(persistenceAdapter);
if (broker != null) {
stopper.stop(broker);
}
if (tempDataStore != null) {
tempDataStore.close();
}
+ stopper.stop(persistenceAdapter);
if (isUseJmx()) {
MBeanServer mbeanServer = getManagementContext().getMBeanServer();
if (mbeanServer != null) {
diff --git a/activemq-jpa-store/src/main/java/org/apache/activemq/store/jpa/JPAPersistenceAdapter.java b/activemq-jpa-store/src/main/java/org/apache/activemq/store/jpa/JPAPersistenceAdapter.java
index e225351b73..066bc32e9c 100755
--- a/activemq-jpa-store/src/main/java/org/apache/activemq/store/jpa/JPAPersistenceAdapter.java
+++ b/activemq-jpa-store/src/main/java/org/apache/activemq/store/jpa/JPAPersistenceAdapter.java
@@ -210,7 +210,7 @@ public class JPAPersistenceAdapter implements PersistenceAdapter {
}
public void stop() throws Exception {
- if (entityManagerFactory != null) {
+ if (entityManagerFactory != null && entityManagerFactory.isOpen()) {
entityManagerFactory.close();
}
}
diff --git a/pom.xml b/pom.xml
index 5e41de5bbc..08dc7f81e4 100755
--- a/pom.xml
+++ b/pom.xml
@@ -46,7 +46,7 @@
2.0
1.6.1
3.1
- 1.0.0
+ 1.2.0
1.2.2
2.0.1
1.1