ARTEMIS-302 - Cloning Connection Factory to avoid closing CFs from JNDI

This commit is contained in:
Clebert Suconic 2015-12-16 19:20:39 -05:00
parent f8741db4a3
commit eddd3be46b
1 changed files with 3 additions and 1 deletions

View File

@ -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);