[
https://issues.apache.org/jira/browse/AMQ-5015?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14028348#comment-14028348
]
Timothy Bish commented on AMQ-5015:
-----------------------------------
The underlying issue here is that the close of the session after the connection
close isn't short circuited and leads to more than one copy of the session
being returned to the session pool. The later calls to create a session then
both get the same session instance returned to them.
The simple fix here is to provide a means for the session to be tagged as
active or not so that a second call to close does nothing. This will work in
most cases however there is an edge case where multiple threads taking and
returning sessions could still incorrectly return the instance to the pool
twice since the state flag get reset on a take from the pool.
> Temp Queue gets deleted on close of wrong connection
> ----------------------------------------------------
>
> Key: AMQ-5015
> URL: https://issues.apache.org/jira/browse/AMQ-5015
> Project: ActiveMQ
> Issue Type: Improvement
> Affects Versions: 5.9.0
> Reporter: Christian Schneider
> Attachments: PooledConnectionTempQueueTest.java
>
>
> My scenario is this:
> connection1:
> create temp queue tq1
> send msg to qeue1 with replyTo tq1
> wait for reply on tq1
> connection2:
> receive message on queue1
> send to replyTo address which is tq1
> In some cases the temp queue gets deleted in the close method of connection2.
> The scenario is kind of an edge case as it only happens if I use a
> PooledConnectionFactory and only if I before my scenario above open a
> connection and session and close the connection before the session.
> So strictly speaking my code has an error.
> I think the problem is in the PooledConnection factory. It seems to reuse a
> connection or session in the wrong way. I will attach a test case
--
This message was sent by Atlassian JIRA
(v6.2#6252)