PooledSession - No way return it back

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

PooledSession - No way return it back

FeiYang
Hi,

I am using PooledConnecitonFactory/PooledConnection to enhance the performance.

After reading the source code, I can create a PooledSession from PooledConnection, but there is no way to return the PooledSession back.

User case:
1. create a PooledSession s1;
2. create a consumer c1 on s2;
3. return the session back so reuse it laterly(no way to do so, and I do not want to close the session as the consumer is under working)

Any one has any suggestion on this?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: PooledSession - No way return it back

FeiYang
Sorry, typo
User case:
1. create a PooledSession s1;
2. create a consumer c1 on s1;
3. return the session back so reuse it laterly(no way to do so, and I do not want to close the session as the consumer is under working)

Any one has any suggestion on this?
Reply | Threaded
Open this post in threaded view
|

Re: PooledSession - No way return it back

ceposta
In reply to this post by FeiYang
The implementation as it is assumes that a Session is not idle if it
has consumers open.. so if you want to return it back to the pool,
you'd close it, which returns it to the pool and closes all consumers.

Can you just hold the session that you have when you first create it?

On Fri, Mar 28, 2014 at 3:27 AM, FeiYang <[hidden email]> wrote:

> Hi,
>
> I am using PooledConnecitonFactory/PooledConnection to enhance the
> performance.
>
> After reading the source code, I can create a PooledSession from
> PooledConnection, but there is no way to return the PooledSession back.
>
> User case:
> 1. create a PooledSession s1;
> 2. create a consumer c1 on s2;
> 3. return the session back so reuse it laterly(no way to do so, and I do not
> want to close the session as the consumer is under working)
>
> Any one has any suggestion on this?
>
> Thanks
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/PooledSession-No-way-return-it-back-tp4679628.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



--
Christian Posta
http://www.christianposta.com/blog
twitter: @christianposta