Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 20205 invoked from network); 9 Sep 2009 17:17:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Sep 2009 17:17:37 -0000 Received: (qmail 84050 invoked by uid 500); 9 Sep 2009 17:17:37 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 84005 invoked by uid 500); 9 Sep 2009 17:17:37 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 83995 invoked by uid 99); 9 Sep 2009 17:17:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Sep 2009 17:17:37 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Sep 2009 17:17:33 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 80BDB234C1F0 for ; Wed, 9 Sep 2009 10:17:12 -0700 (PDT) Message-ID: <1537184196.1252516632526.JavaMail.jira@brutus> Date: Wed, 9 Sep 2009 10:17:12 -0700 (PDT) From: "Rob Davies (JIRA)" To: dev@activemq.apache.org Subject: [jira] Resolved: (AMQ-2249) The pool is not being informed that invalid PooledSessions are being thrown away In-Reply-To: <458263650.1242167930571.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/AMQ-2249?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Rob Davies resolved AMQ-2249. ----------------------------- Resolution: Fixed Fix Version/s: 5.3.0 patch applied in revision 813053 > The pool is not being informed that invalid PooledSessions are being thrown away > -------------------------------------------------------------------------------- > > Key: AMQ-2249 > URL: https://issues.apache.org/activemq/browse/AMQ-2249 > Project: ActiveMQ > Issue Type: Bug > Components: Broker > Affects Versions: 5.2.0 > Environment: Windows XP using ActiveMQ in conjunction with Jencks, Spring and JOTM. > Reporter: Phillip Henry > Assignee: Rob Davies > Fix For: 5.3.0 > > > PooledConnection.close() calls rollback() on the internal session. However, when the internal session is an instance of ActiveMQXASession, this always results in a TransactionInProgressException being thrown (and subsequently caught). Unfortunately, in this path of execution, the session pool is not informed. > The sessionPool knows nothing about the session being discarded and ultimately, GenericObjectPool.borrowObject() blocks forever since _numActive is never decremented. > I think the pool should at least be told that the session has been invalidated (this is not a full fix but should at least stop any hanging threads). Below is a partial patch (I'll work on a full solution when I have time): > {code} > Index: activemq-pool/src/main/java/org/apache/activemq/pool/PooledSession.java > =================================================================== > --- activemq-pool/src/main/java/org/apache/activemq/pool/PooledSession.java (revision 768326) > +++ activemq-pool/src/main/java/org/apache/activemq/pool/PooledSession.java (working copy) > @@ -120,6 +120,7 @@ > LOG.trace("Ignoring exception as discarding session: " + e1, e1); > } > session = null; > + sessionPool.invalidateSession(this); > return; > } > } > Index: activemq-pool/src/main/java/org/apache/activemq/pool/SessionPool.java > =================================================================== > --- activemq-pool/src/main/java/org/apache/activemq/pool/SessionPool.java (revision 768326) > +++ activemq-pool/src/main/java/org/apache/activemq/pool/SessionPool.java (working copy) > @@ -59,6 +59,14 @@ > throw JMSExceptionSupport.create(e); > } > } > + > + public void invalidateSession(PooledSession session) throws JMSException { > + try { > + getSessionPool().invalidateObject(session); > + } catch (Exception e) { > + throw JMSExceptionSupport.create("Failed to invalidate session: " + e, e); > + } > + } > > public void returnSession(PooledSession session) throws JMSException { > // lets check if we are already closed > {code} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.