Connection is leaked when an exception occurs during getConnection for a NoTransaction JCA adapter in JBoss EAP

Solution Verified - Updated -

Issue

  • A NoTransaction resource adapter encounters an exception (e.g. due to network issues) while attempting to provide a connection to satisfy an application request

    ... WARNING [support.jboss.ejb.session.SessionBean] (ServerService Thread Pool -- 51) Failed to get a connection: IJ000456: Unchecked throwable in ManagedConnection.getConnection() cl=org.jboss.jca.core.connectionmanager.listener.NoTxConnectionListener@1a933f80[state=NORMAL managed connection=support.redhat.jboss.jca.ManagedConnectionImpl@7a294431 connection handles=0 lastUse=1575419355891 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@1d6a5362 pool internal context=SemaphoreArrayListManagedConnectionPool@2f47607f[pool=EisConnectionFactory]]: javax.resource.ResourceException: IJ000456: Unchecked throwable in ManagedConnection.getConnection() cl=org.jboss.jca.core.connectionmanager.listener.NoTxConnectionListener@1a933f80[state=NORMAL managed connection=support.redhat.jboss.jca.ManagedConnectionImpl@7a294431 connection handles=0 lastUse=1575419355891 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@1d6a5362 pool internal context=SemaphoreArrayListManagedConnectionPool@2f47607f[pool=EisConnectionFactory]]
        at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:521)
        at support.redhat.jboss.jca.ConnectionFactoryImpl.getConnection(ConnectionFactoryImpl.java:61)
        ...
    Caused by: javax.resource.ResourceException: Simulate timeout
        at support.redhat.jboss.jca.ManagedConnectionImpl.getConnection(ManagedConnectionImpl.java:61)
        at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:508)
        ...
    
  • The connection is left in the InUse state and is never returned to the pool though no connection is returned to the application.

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6
    • 7
  • IronJacamar
    • 1.0
    • 1.3
    • 1.4

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content