[ openjms-Bugs-938163 ] Session not removing producers

"SourceForge.net" <[email protected]> Fri, 30 Apr 2004 21:59:38 -0700
Newsgroups gmane.comp.java.openjms.devel
Message-ID <[email protected]>
Bugs item #938163, was opened at 2004-04-20 06:41
Message generated for change (Comment added) made by tanderson
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=474136&aid=938163&group_id=54559

>Category: client
>Group: v0.7.6
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Preston McFarland (mcfarlandp)
>Assigned to: Tim Anderson (tanderson)
Summary: Session not removing producers

Initial Comment:
he JMSMessageProducer has a isClossed method.

public synchronized boolean isClosed() {
        return (_session != null);
    }


This method is called by the close methods of 
JMSQueueSender and 
JMSTopicPublisher.

   public synchronized void close() throws JMSException 
{
        if (!isClosed()) {
            // unregister this producer from the session 
before closing.
            // and then call the base class method.
            JmsQueueSession session = (JmsQueueSession) 
getSession();
            session.removeSender(this);
            super.close();
        }
    }

The problem is that isClosed is returning true when the 
JMSMessageProducer is 
not null. The close method then skips the 
session.RemoveSender() because it 
thinks the session is null.

All of the producers are stored in a vector in the 
Session. Since removeSender 
isn’t getting called this vector continues to grow 
indefinitely.


The patch is simply to change isClosed() as follows

public synchronized boolean isClosed() {
        return (_session == null);
    }


----------------------------------------------------------------------

>Comment By: Tim Anderson (tanderson)
Date: 2004-05-01 14:59

Message:
Logged In: YES 
user_id=557161

Fixed in CVS. Fix will be available in the 0.7.6.1 release.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=474136&aid=938163&group_id=54559


-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click