Uploaded image for project: 'IronJacamar'
  1. IronJacamar
  2. JBJCA-1398

Connection leak when there is an exception during getConnection for NoTransaction resource adapter

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Done
    • 1.0.31.Final, 1.0.38.Final, 1.4.10
    • None
    • Core
    • Release Notes

    Description

      When an exception occurs with a NoTransaction resource adapter during a getConnection attempt the pool leaks the connection. The exception (simulating a timeout of the underlying connect attempt) detail is below.

      ... 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)
      	...
      

      There seems to be a difference in a NoTransaction and an XATransaction adapter where returnConnection is triggered by the TxConnectionManagerImpl.

      ... [BMAN] org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.returnConnection(SemaphoreArrayListManagedConnectionPool.java:-1)
      ... org.jboss.jca.core.connectionmanager.pool.AbstractPool.returnConnection(AbstractPool.java:633)
      ... org.jboss.jca.core.connectionmanager.AbstractConnectionManager.returnManagedConnection(AbstractConnectionManager.java:456)
      ... org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.managedConnectionDisconnected(TxConnectionManagerImpl.java:515)
      ... org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:525)
      

      For a NoTransaction adapter, however, the abstract implementation is used:

      ... [BMAN] org.jboss.jca.core.connectionmanager.AbstractConnectionManager.managedConnectionDisconnected(AbstractConnectionManager.java:697)
      ... org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:525)
      

      The empty implementation for AbstractConnectionManager.managedConnectionDisconnected does nothing so the connection is not returned as it would be for a transactional implementation.

      I also see the same issue with IronJacamar 1.4.18.Final so this issue remains in the latest release.

      Attachments

        Issue Links

          Activity

            People

              smaestri@redhat.com Stefano Maestri
              rhn-support-sfikes Stephen Fikes
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: