openmq icon indicating copy to clipboard operation
openmq copied to clipboard

MQ-JMSRA pooled connection validation broken: ManagedConnectionFactory does not implement ValidatingManagedConnectionFactory

Open svendiedrichsen opened this issue 5 years ago • 0 comments

The class com.sun.messaging.jms.ra.ManagedConnectionFactory does not implement the interface javax.resource.spi.ValidatingManagedConnectionFactory. This prevents Application-Servers like i.e. Glassfish/Payara 4/5 to validate pooled JMS connections and has a variety of negative effects in case of broken connections.

// code excerpt from com.sun.enterprise.resource.allocator.AbstractConnectorAllocator
... 
public Set getInvalidConnections(Set connectionSet)
            throws ResourceException {
        if (mcf instanceof ValidatingManagedConnectionFactory) {
            return ((ValidatingManagedConnectionFactory) this.mcf).
                    getInvalidConnections(connectionSet);
        }
        return null;
    }
...

svendiedrichsen avatar Oct 01 '18 11:10 svendiedrichsen