From ca819eed8a8cd1eeaddda0d2990c1547dc70aa3f Mon Sep 17 00:00:00 2001 From: markpollack Date: Tue, 28 Jul 2009 19:58:14 +0000 Subject: [PATCH] SPRNET-1222 MessageQueueFactoryObject.GetObject() sets global MessageQueue.EnableConnectionCache property --- .../Listener/AbstractMessageListenerContainer.cs | 8 ++------ .../Messaging/Support/MessageQueueFactoryObject.cs | 2 -- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/Spring/Spring.Messaging/Messaging/Listener/AbstractMessageListenerContainer.cs b/src/Spring/Spring.Messaging/Messaging/Listener/AbstractMessageListenerContainer.cs index e6774f29..2e4127ab 100644 --- a/src/Spring/Spring.Messaging/Messaging/Listener/AbstractMessageListenerContainer.cs +++ b/src/Spring/Spring.Messaging/Messaging/Listener/AbstractMessageListenerContainer.cs @@ -228,17 +228,13 @@ namespace Spring.Messaging.Listener /// /// Closes the queue handle. Cancel pending receive operation by closing the queue handle - /// To dispose of the queue handle, set EnableConnectionCache=false and call Close/Dispose. + /// To properly dispose of the queue handle, ensure that EnableConnectionCache=false on the + /// MessageQueue that this listener is configured to use. /// protected void CloseQueueHandle(MessageQueue mq) { lock (messageQueueMonitor) { - if (MessageQueue.EnableConnectionCache == true) - { - LOG.Info("Setting global property MessageQueue.EnableConnectionCache from true to value in order to dispose property of the queue handle"); - } - MessageQueue.EnableConnectionCache = false; mq.Close(); mq.Dispose(); } diff --git a/src/Spring/Spring.Messaging/Messaging/Support/MessageQueueFactoryObject.cs b/src/Spring/Spring.Messaging/Messaging/Support/MessageQueueFactoryObject.cs index c8c45c59..8a8a2374 100644 --- a/src/Spring/Spring.Messaging/Messaging/Support/MessageQueueFactoryObject.cs +++ b/src/Spring/Spring.Messaging/Messaging/Support/MessageQueueFactoryObject.cs @@ -202,8 +202,6 @@ namespace Spring.Messaging.Support } else { - // TODO (EE): is it really a good idea to set a global property from within an instance? - MessageQueue.EnableConnectionCache = enableConnectionCache; MessageQueue mq = new MessageQueue(Path, DenySharedReceive, EnableCache, AccessMode); if (messageReadPropertyFilterSetDefaults) {