From 2de531cb5209e0aa8ce46f18379619352583f6ba Mon Sep 17 00:00:00 2001 From: Bosanac Dejan Date: Mon, 23 Feb 2009 14:36:03 +0000 Subject: [PATCH] fix for https://issues.apache.org/activemq/browse/AMQ-2074 git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@747030 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/org/apache/activemq/broker/BrokerService.java | 2 +- .../org/apache/activemq/store/jpa/JPAPersistenceAdapter.java | 2 +- pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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