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

Torsten Mielke commented on AMQ-6700:
-------------------------------------

A fix for this bug is to catch and deal with these Exceptions in method 
{{ActiveMQResourceAdapter.$2.newConnection()}}

{code:java}
                        private ActiveMQConnection newConnection() throws 
JMSException {
                            ActiveMQConnection connection = null;
                            try {
                                connection = makeConnection();
                                connection.start();
                            } catch (JMSException ex) {
                                if (connection != null) {
                                    try {
                                        connection.close();
                                    } catch (JMSException ignore) { }
                                }
                                throw ex;
                            }
                            return connection;
                        }
{code}

> Leak of "ActiveMQ Connection Executor" threads and ActiveMQConnection objects 
> in JCA
> ------------------------------------------------------------------------------------
>
>                 Key: AMQ-6700
>                 URL: https://issues.apache.org/jira/browse/AMQ-6700
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JCA Container, RAR
>    Affects Versions: 5.14.5
>         Environment: JCA
>            Reporter: Torsten Mielke
>            Assignee: Torsten Mielke
>              Labels: jca
>
> The ActiveMQ JCA layer may leak threads of name {{"ActiveMQ Connection 
> Executor"}} and instances of {{org.apache.activemq.ActiveMQConnection}} when 
> there are problems with establishing the connection. 
> If the initial openwire connection cannot be established, it may run an 
> "ActiveMQ Connection Executor" thread to deal with the error leading to a 
> code path that does not close the connection and does not clear up the 
> "ActiveMQ Connection Executor" thread.
> Low level details in further comments.
>  
> This problem can be reproduced by running 
> {{ActiveMQResourceAdapter.TransactionContext.recover()}} but potentially 
> other code paths in the resource adapter are effected as well.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to