Repository: activemq-artemis Updated Branches: refs/heads/master f8741db4a -> 327299965
ARTEMIS-302 - Cloning Connection Factory to avoid closing CFs from JNDI Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/eddd3be4 Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/eddd3be4 Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/eddd3be4 Branch: refs/heads/master Commit: eddd3be46b295e825973664d6358b1d3aea83047 Parents: f8741db Author: Clebert Suconic <[email protected]> Authored: Wed Dec 16 19:20:39 2015 -0500 Committer: Clebert Suconic <[email protected]> Committed: Wed Dec 16 19:20:39 2015 -0500 ---------------------------------------------------------------------- .../apache/activemq/artemis/ra/inflow/ActiveMQActivation.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/eddd3be4/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivation.java ---------------------------------------------------------------------- diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivation.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivation.java index d7a242d..f42db64 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivation.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivation.java @@ -463,7 +463,9 @@ public class ActiveMQActivation { } Object fac = ctx.lookup(spec.getConnectionFactoryLookup()); if (fac instanceof ActiveMQConnectionFactory) { - factory = (ActiveMQConnectionFactory) fac; + // This will clone the connection factory + // to make sure we won't close anyone's connection factory when we stop the MDB + factory = ActiveMQJMSClient.createConnectionFactory(((ActiveMQConnectionFactory) fac).toURI().toString(), "internalConnection"); } else { factory = ra.newConnectionFactory(spec);
