summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to 'java')
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java b/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java
index fceaf75a9e..715dd0c385 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java
@@ -84,6 +84,7 @@ public class QueueEntryImpl implements QueueEntry
private static final byte IMMEDIATE_AND_DELIVERED = (byte) (IMMEDIATE | DELIVERED_TO_CONSUMER);
private boolean _persistent;
+ private boolean _hasBeenUnloaded = false;
QueueEntryImpl(SimpleQueueEntryList queueEntryList)
{
@@ -407,11 +408,16 @@ public class QueueEntryImpl implements QueueEntry
try
{
- _backingStore.unload(_message);
-
- if (_log.isDebugEnabled())
+ if (!_hasBeenUnloaded)
{
- _log.debug("Unloaded:" + debugIdentity());
+ _hasBeenUnloaded = true;
+
+ _backingStore.unload(_message);
+
+ if (_log.isDebugEnabled())
+ {
+ _log.debug("Unloaded:" + debugIdentity());
+ }
}
_message = null;
@@ -502,7 +508,7 @@ public class QueueEntryImpl implements QueueEntry
if (state != DELETED_STATE && _stateUpdater.compareAndSet(this, state, DELETED_STATE))
{
_queueEntryList.advanceHead();
- if (_backingStore != null)
+ if (_backingStore != null && _hasBeenUnloaded)
{
_backingStore.delete(_messageId);
}