[jboss-cvs] JBoss Messaging SVN: r2413 - branches/Branch_1_0_1_SP/src/main/org/jboss/jms/server/endpoint.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sat Feb 24 05:06:40 EST 2007


Author: timfox
Date: 2007-02-24 05:06:39 -0500 (Sat, 24 Feb 2007)
New Revision: 2413

Modified:
   branches/Branch_1_0_1_SP/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
Log:
Fix for http://jira.jboss.org/jira/browse/JBMESSAGING-864


Modified: branches/Branch_1_0_1_SP/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
===================================================================
--- branches/Branch_1_0_1_SP/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java	2007-02-24 06:12:45 UTC (rev 2412)
+++ branches/Branch_1_0_1_SP/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java	2007-02-24 10:06:39 UTC (rev 2413)
@@ -369,7 +369,17 @@
                channel.removeAllReferences();
             }
 
-            this.remove();
+            //Fix for http://jira.jboss.org/jira/browse/JBMESSAGING-864
+            //When this is closed, if there are no deliveries then we can remove immediately
+            //otherwise we must wait to session close
+            //This is because it is perfectly valid to close a consumer then ack
+            //it's deliveries later on the session (e.g. when it commits or client ack)
+            //In the case of JCA which caches sessions, there won't be any deliveries
+            //so we will close immediately - preventing a leak
+            if (deliveries.isEmpty())
+            {
+               remove();
+            }
             
             closed = true;
          }




More information about the jboss-cvs-commits mailing list