BTW to avoid having to write all the code to explicitly close things down you can use the JmsTemplate or MessageListenerContainer helper classes in the spring framework.
2008/7/28 rodih <[EMAIL PROTECTED]>: > > Thanks for the quick response. I will take your advice and will close > resources explicitly. > BTW, Are connections and session behave the same (are closing resources the > same as consumers/producers when finalized). > > Thanks again. > > > rajdavies wrote: >> >> >> On 28 Jul 2008, at 07:17, rodih wrote: >> >>> >>> Hi, >>> If I define a new producer or consumer as a local variable will it >>> be closed >>> (Closed + Garbage collected at some point) once the method returns? >>> >>> Thanks. >>> >>> -- >>> View this message in context: >>> http://www.nabble.com/Closing-Producers-tp18684689p18684689.html >>> Sent from the ActiveMQ - User mailing list archive at Nabble.com. >>> >> >> Yes they should be if you use ActiveMQ - however I wouldn't >> recommend it - as its specific to ActiveMQ (not every JMS client will >> do the same) - and gc is not very deterministic anyway. >> It would be better to close them explicitly >> >> >> >> >> cheers, >> >> Rob >> >> http://open.iona.com/products/enterprise-activemq >> http://rajdavies.blogspot.com/ >> >> >> >> >> >> > > -- > View this message in context: > http://www.nabble.com/Closing-Producers-tp18684689p18688165.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > > -- James ------- http://macstrac.blogspot.com/ Open Source Integration http://open.iona.com