Inaccurate IJ000100 leak warnings in certain cases when using Cached Connection Manager debug in JBoss EAP 7.1

Solution Verified - Updated

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP) 7.1
  • IronJacamar (JCA) 1.4

Issue

  • The database has been shutdown and connection validation fails while getting a connection

  • Cached connection manager debug has been enabled to check for leaks

  • The connection is reported as having been leaked though it was never returned to the component requesting it

    ... IJ000100: Closing a connection for you. Please close them yourself: org.jboss.jca.adapters.jdbc.jdk8.WrappedConnectionJDK8@55f66f3c: java.lang.Throwable: STACKTRACE
        at org.jboss.jca.core.connectionmanager.ccm.CachedConnectionManagerImpl.registerConnection(CachedConnectionManagerImpl.java:308)
        at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:819)
        at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:138)
        at org.jboss.as.connector.subsystems.datasources.WildFlyDataSource.getConnection(WildFlyDataSource.java:64)
        at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122)
        ...
    

Resolution

This issue1 is resolved in This content is not included.EAP 7.1 cumulative patch (CP) 4 and later releases.

One of the following may be used to work around the issue in older patch levels:

  • Enable the enlistment-trace property for the non-XA or XA datasource to revert to the JBoss EAP 7.0 behavior

    <[xa-]datasource ... enlistment-trace="true" ...>
        ...
    </[xa-]datasource>
    
  • Use the leak dumper pool for investigating connection leaks

Note that the warning may be ignored when raised in the context of failure during getConnection() (i.e. due to lost connectivity).

Root Cause

This is a known issue (Content from issues.jboss.org is not included.JBJCA-1377) introduced by a change in EAP 7.1 where enlistment-trace now defaults to false whereas it defaulted to true in previous releases.

Components
Category
Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.