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

Solution Verified - Updated

Environment

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

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.

Resolution

This issue is resolved as part of:

An issue remains open for EAP 6.42.

Root Cause

This is a known defect (Content from issues.jboss.org is not included.JBJCA-1398).

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.