From 0ac3f165dcadc709b858571ccc5c43401369ae23 Mon Sep 17 00:00:00 2001 From: Robert Davies Date: Thu, 13 Dec 2007 14:45:01 +0000 Subject: [PATCH] changed unlock() method to use remove() instead of clearProperty as this doesn't work on some platforms git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@603927 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/org/apache/activemq/kaha/impl/KahaStore.java | 4 +++- .../apache/activemq/store/amq/AMQPersistenceAdapter.java | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java index add6f0bf27..d7e9c0254b 100644 --- a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java +++ b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java @@ -503,9 +503,11 @@ public class KahaStore implements Store { private synchronized void unlock() throws IOException { if (!DISABLE_LOCKING && (null != directory) && (null != lock)) { - System.clearProperty(getPropertyKey()); + //clear property doesn't work on some platforms + System.getProperties().remove(getPropertyKey()); if (lock.isValid()) { lock.release(); + lock.channel().close(); } lock = null; } diff --git a/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java b/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java index 1c2f1f09ec..6822504bb5 100644 --- a/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java +++ b/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java @@ -887,10 +887,12 @@ public class AMQPersistenceAdapter implements PersistenceAdapter, UsageListener, } private synchronized void unlock() throws IOException { - if (!disableLocking && (null != directory) && (null != lock)) { - System.clearProperty(getPropertyKey()); + if (!disableLocking && (null != lock)) { + //clear property doesn't work on some platforms + System.getProperties().remove(getPropertyKey()); if (lock.isValid()) { lock.release(); + lock.channel().close(); } lock = null; }