You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Adrian Tarau <ad...@daxtechnologies.com> on 2006/06/02 16:20:37 UTC

Connection close

I have broker with VM connector and I keep one session to this 
connector. After a while I cannot consume messages, I got 
"avax.jms.IllegalStateException: The Session is closed" even if I don't 
close the connection.

Is not safe to keep a session opened for a long time? There is some 
background job that close long running sessions?
Thanks.

Re: Connection close

Posted by Adrian Tarau <ad...@daxtechnologies.com>.
In incubator-activemq-4-0.

And I meant to say : "

and the connection and *broker* on a shutdown hook:


Christopher G. Stach II wrote:
> Adrian Tarau wrote:
>   
>> Well, I searched again the whole code(after close() ), and is not too
>> much code to search, I close only Consumers, Producers, Writers,
>> OutputStreams, and the connection and browse on a shutdown hook. Maybe
>> I'm wrong but I'm pretty sure I do I don't close the connection.
>> The strange thing is that is happened random, cannot figure out the
>> conditions. Once it was at 3 minutes after I started the application,
>> that was strange !!!
>>
>> James Strachan wrote:
>>     
>>> On 6/2/06, Adrian Tarau <ad...@daxtechnologies.com> wrote:
>>>       
>>>> I have broker with VM connector and I keep one session to this
>>>> connector. After a while I cannot consume messages, I got
>>>> "avax.jms.IllegalStateException: The Session is closed" even if I don't
>>>> close the connection.
>>>>         
>>> Sounds like the connection was closed. You positive you're not closing
>>> it someplace? You're not using Spring's JmsTemplate or anything?
>>>
>>>
>>>       
>>>> Is not safe to keep a session opened for a long time?
>>>>         
>>> It should work.
>>>
>>>       
>>>> There is some
>>>> background job that close long running sessions?
>>>>         
>>> We have an inactivity timeout you can enable on a transport which will
>>> close inactive connections on the broker side - other than that no.
>>>       
>
> I might have missed it, but which version?  We have this happen with
> 3.2.2 all of the time, and 4.0 in certain conditions involving rollbacks.
>
>   


Re: Connection close

Posted by "Christopher G. Stach II" <cg...@ldsys.net>.
Adrian Tarau wrote:
> Well, I searched again the whole code(after close() ), and is not too
> much code to search, I close only Consumers, Producers, Writers,
> OutputStreams, and the connection and browse on a shutdown hook. Maybe
> I'm wrong but I'm pretty sure I do I don't close the connection.
> The strange thing is that is happened random, cannot figure out the
> conditions. Once it was at 3 minutes after I started the application,
> that was strange !!!
> 
> James Strachan wrote:
>> On 6/2/06, Adrian Tarau <ad...@daxtechnologies.com> wrote:
>>>
>>> I have broker with VM connector and I keep one session to this
>>> connector. After a while I cannot consume messages, I got
>>> "avax.jms.IllegalStateException: The Session is closed" even if I don't
>>> close the connection.
>>
>> Sounds like the connection was closed. You positive you're not closing
>> it someplace? You're not using Spring's JmsTemplate or anything?
>>
>>
>>> Is not safe to keep a session opened for a long time?
>>
>> It should work.
>>
>>> There is some
>>> background job that close long running sessions?
>>
>> We have an inactivity timeout you can enable on a transport which will
>> close inactive connections on the broker side - other than that no.
> 

I might have missed it, but which version?  We have this happen with
3.2.2 all of the time, and 4.0 in certain conditions involving rollbacks.

-- 
Christopher G. Stach II

Re: Connection close

Posted by Adrian Tarau <ad...@daxtechnologies.com>.
Well, I searched again the whole code(after close() ), and is not too 
much code to search, I close only Consumers, Producers, Writers, 
OutputStreams, and the connection and browse on a shutdown hook. Maybe 
I'm wrong but I'm pretty sure I do I don't close the connection.
The strange thing is that is happened random, cannot figure out the 
conditions. Once it was at 3 minutes after I started the application, 
that was strange !!!

James Strachan wrote:
> On 6/2/06, Adrian Tarau <ad...@daxtechnologies.com> wrote:
>>
>> I have broker with VM connector and I keep one session to this
>> connector. After a while I cannot consume messages, I got
>> "avax.jms.IllegalStateException: The Session is closed" even if I don't
>> close the connection.
>
> Sounds like the connection was closed. You positive you're not closing
> it someplace? You're not using Spring's JmsTemplate or anything?
>
>
>> Is not safe to keep a session opened for a long time?
>
> It should work.
>
>> There is some
>> background job that close long running sessions?
>
> We have an inactivity timeout you can enable on a transport which will
> close inactive connections on the broker side - other than that no.


Re: Connection close

Posted by James Strachan <ja...@gmail.com>.
On 6/2/06, Adrian Tarau <ad...@daxtechnologies.com> wrote:
>
> I have broker with VM connector and I keep one session to this
> connector. After a while I cannot consume messages, I got
> "avax.jms.IllegalStateException: The Session is closed" even if I don't
> close the connection.

Sounds like the connection was closed. You positive you're not closing
it someplace? You're not using Spring's JmsTemplate or anything?


> Is not safe to keep a session opened for a long time?

It should work.

> There is some
> background job that close long running sessions?

We have an inactivity timeout you can enable on a transport which will
close inactive connections on the broker side - other than that no.
-- 

James
-------
http://radio.weblogs.com/0112098/