You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Henrik Olsson (Commented) (JIRA)" <ji...@apache.org> on 2011/09/28 11:06:45 UTC

[jira] [Commented] (AMQ-2643) Closing a PooledConnection does not seem to return associated sessions to the SessionPool

    [ https://issues.apache.org/jira/browse/AMQ-2643?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13116302#comment-13116302 ] 

Henrik Olsson commented on AMQ-2643:
------------------------------------

Attached a test case showing that continously requesting a connection (and a a session) from a ConnectionFactory that happens to be a PooledConnectionFactory and only closing the connection, not the session, eventually exhausts the session pool. This seems to break the contract of Connection.close since the official documentation for it states that "There is no need to close the sessions, producers, and consumers of a closed connection."
                
> Closing a PooledConnection does not seem to return associated sessions to the SessionPool
> -----------------------------------------------------------------------------------------
>
>                 Key: AMQ-2643
>                 URL: https://issues.apache.org/jira/browse/AMQ-2643
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.2.0
>            Reporter: Henrik Olsson
>         Attachments: SimpleTest.java
>
>
> Reading the documentation at http://java.sun.com/j2ee/1.4/docs/api/javax/jms/Connection.html#close() one would assume the associated session(s) would be closed/returned to the SessionPool when closing a connection: "There is no need to close the sessions, producers, and consumers of a closed connection."
> But it seems if you don't also explicitly call close() on the session you will run out of Session objects in the SessionPool. 
> Looking at http://www.google.com/codesearch/p?hl=en#coOE0tRomSs/trunk/activemq-core/src/main/java/org/apache/activemq/pool/PooledConnection.java&d=9&l=69 trunk seems to have the same behaviour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira