[ openjms-Bugs-938163 ] Session not removing producers

"SourceForge.net" <[email protected]> Mon, 19 Apr 2004 13:41:11 -0700
Newsgroups gmane.comp.java.openjms.devel
Message-ID <[email protected]>
Bugs item #938163, was opened at 2004-04-19 14:41
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=474136&aid=938163&group_id=54559

Category: message engine
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Preston McFarland (mcfarlandp)
Assigned to: Jim Alateras (jalateras)
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);
    }


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

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: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click