Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » IllegalStateException, unknown connection on second transaction in request on JBoss EAP 7.3 server
IllegalStateException, unknown connection on second transaction in request on JBoss EAP 7.3 server [message #1835584] Mon, 07 December 2020 16:13 Go to next message
Geert-Jan Hut is currently offline Geert-Jan HutFriend
Messages: 5
Registered: September 2009
Junior Member
We migrated our JEE application from JBoss EAP 6.4 to 7.3.3, and saw that the below exceptions starting appearing. These exceptions only occur for requests where we have database requests with two consecutive transactions in a single web request.
Moving all requests to one transaction makes the issue disappear. The issue also disappears when we use Hibernate instead of EclipseLink as JPA implementation.

The database we use is Oracle 12 and 19. The eclipselink version we use is 2.7.7.

Apart from this stacktrace the application seems to function correctly.

I have added a stacktrace to the method that executes the (second) transaction.

Does anybody know what is happening here? How serious should we take this exception?

03122020 02:19:31,342 INFO  [org.jboss.jca.core.connectionmanager.listener.TxConnectionListener] (default task-1) IJ000311: Throwable from unregister connection: java.lang.IllegalStateException: IJ000152: Trying to return an unknown connection: org.jboss.jca.adapters.jdbc.jdk8.WrappedConnectionJDK8@2cb1594b
        at org.jboss.ironjacamar.impl@1.4.22.Final-redhat-00001//org.jboss.jca.core.connectionmanager.ccm.CachedConnectionManagerImpl.unregisterConnection(CachedConnectionManagerImpl.java:408)
        at org.jboss.ironjacamar.impl@1.4.22.Final-redhat-00001//org.jboss.jca.core.connectionmanager.listener.TxConnectionListener.connectionClosed(TxConnectionListener.java:645)
        at org.jboss.ironjacamar.jdbcadapters@1.4.22.Final-redhat-00001//org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.returnHandle(BaseWrapperManagedConnection.java:600)
        at org.jboss.ironjacamar.jdbcadapters@1.4.22.Final-redhat-00001//org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.closeHandle(BaseWrapperManagedConnection.java:545)
        at org.jboss.ironjacamar.jdbcadapters@1.4.22.Final-redhat-00001//org.jboss.jca.adapters.jdbc.WrappedConnection.returnConnection(WrappedConnection.java:307)
        at org.jboss.ironjacamar.jdbcadapters@1.4.22.Final-redhat-00001//org.jboss.jca.adapters.jdbc.WrappedConnection.close(WrappedConnection.java:265)
        at deployment.kharon-rest.war//org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.closeDatasourceConnection(DatabaseAccessor.java:502)
        at deployment.kharon-rest.war//org.eclipse.persistence.internal.databaseaccess.DatasourceAccessor.closeConnection(DatasourceAccessor.java:524)
        at deployment.kharon-rest.war//org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.closeConnection(DatabaseAccessor.java:527)
        at deployment.kharon-rest.war//org.eclipse.persistence.internal.databaseaccess.DatasourceAccessor.closeJTSConnection(DatasourceAccessor.java:190)
        at deployment.kharon-rest.war//org.eclipse.persistence.sessions.server.ClientSession.releaseJTSConnection(ClientSession.java:175)
        at deployment.kharon-rest.war//org.eclipse.persistence.transaction.AbstractSynchronizationListener.beforeCompletion(AbstractSynchronizationListener.java:177)
        at deployment.kharon-rest.war//org.eclipse.persistence.transaction.JTASynchronizationListener.beforeCompletion(JTASynchronizationListener.java:70)
        at org.wildfly.transaction.client@1.1.13.Final-redhat-00001//org.wildfly.transaction.client.AbstractTransaction.performConsumer(AbstractTransaction.java:236)
        at org.wildfly.transaction.client@1.1.13.Final-redhat-00001//org.wildfly.transaction.client.AbstractTransaction.performConsumer(AbstractTransaction.java:247)
        at org.wildfly.transaction.client@1.1.13.Final-redhat-00001//org.wildfly.transaction.client.AbstractTransaction$AssociatingSynchronization.beforeCompletion(AbstractTransaction.java:292)
        at org.jboss.jts//com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:76)
        at org.jboss.jts//com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:360)
        at org.jboss.jts//com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:91)
        at org.jboss.jts//com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:162)
        at org.jboss.jts//com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1287)
        at org.jboss.jts//com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:126)
        at org.jboss.jts.integration//com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:94)
        at org.wildfly.transaction.client@1.1.13.Final-redhat-00001//org.wildfly.transaction.client.LocalTransaction.commitAndDissociate(LocalTransaction.java:78)
        at org.wildfly.transaction.client@1.1.13.Final-redhat-00001//org.wildfly.transaction.client.ContextTransactionManager.commit(ContextTransactionManager.java:71)
        at org.jboss.as.ejb3@7.3.3.GA-redhat-00004//org.jboss.as.ejb3.tx.CMTTxInterceptor.endTransaction(CMTTxInterceptor.java:89)
        at org.jboss.as.ejb3@7.3.3.GA-redhat-00004//org.jboss.as.ejb3.tx.CMTTxInterceptor.endTransaction(CMTTxInterceptor.java:89)
        at org.jboss.as.ejb3@7.3.3.GA-redhat-00004//org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:280)
        at org.jboss.as.ejb3@7.3.3.GA-redhat-00004//org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:386)
        at org.jboss.as.ejb3@7.3.3.GA-redhat-00004//org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:156)
        at org.jboss.invocation@1.5.3.Final-redhat-00001//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
        at org.jboss.invocation@1.5.3.Final-redhat-00001//org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:509)
        at org.jboss.weld.core@3.1.4.Final-redhat-00001//org.jboss.weld.module.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:72)
        at org.jboss.as.weld.common@7.3.3.GA-redhat-00004//org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:89)
        at org.jboss.invocation@1.5.3.Final-redhat-00001//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
        at org.jboss.as.ejb3@7.3.3.GA-redhat-00004//org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
        at org.jboss.invocation@1.5.3.Final-redhat-00001//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
        at org.jboss.as.ejb3@7.3.3.GA-redhat-00004//org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:47)
        at org.jboss.invocation@1.5.3.Final-redhat-00001//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
        at org.jboss.as.ejb3@7.3.3.GA-redhat-00004//org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:100)
        at org.jboss.invocation@1.5.3.Final-redhat-00001//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
        at org.jboss.as.ejb3@7.3.3.GA-redhat-00004//org.jboss.as.ejb3.deployment.processors.StartupAwaitInterceptor.processInvocation(StartupAwaitInterceptor.java:22)
        at org.jboss.invocation@1.5.3.Final-redhat-00001//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
        at org.jboss.invocation@1.5.3.Final-redhat-00001//org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:509)
        at org.jboss.as.ejb3@7.3.3.GA-redhat-00004//org.jboss.as.ejb3.component.singleton.ContainerManagedConcurrencyInterceptor.processInvocation(ContainerManagedConcurrencyInterceptor.java:106)
        at org.jboss.invocation@1.5.3.Final-redhat-00001//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
        at org.jboss.as.ejb3@7.3.3.GA-redhat-00004//org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)
        at org.jboss.invocation@1.5.3.Final-redhat-00001//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
        at org.jboss.as.ejb3@7.3.3.GA-redhat-00004//org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:67)
        at org.jboss.invocation@1.5.3.Final-redhat-00001//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
        at org.jboss.as.ee@7.3.3.GA-redhat-00004//org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
        at org.jboss.invocation@1.5.3.Final-redhat-00001//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
        at org.jboss.invocation@1.5.3.Final-redhat-00001//org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:60)
        at org.jboss.invocation@1.5.3.Final-redhat-00001//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
        at org.jboss.invocation@1.5.3.Final-redhat-00001//org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:438)
        at org.wildfly.security.elytron-private@1.10.8.Final-redhat-00001//org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:628)
        at org.jboss.invocation@1.5.3.Final-redhat-00001//org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:57)
        at org.jboss.invocation@1.5.3.Final-redhat-00001//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
        at org.jboss.invocation@1.5.3.Final-redhat-00001//org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:53)
        at org.jboss.as.ee@7.3.3.GA-redhat-00004//org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:198)
        at org.jboss.as.ee@7.3.3.GA-redhat-00004//org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:191)
        at org.jboss.as.ee@7.3.3.GA-redhat-00004//org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:81)
        at deployment.kharon-rest.war//com.example.services.dao.interfaces.UserDao$$$view4.getAccesStrings(Unknown Source)

Re: IllegalStateException, unknown connection on second transaction in request on JBoss EAP 7.3 serv [message #1835595 is a reply to message #1835584] Mon, 07 December 2020 23:09 Go to previous messageGo to next message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1388
Registered: July 2009
Senior Member
Turn on EclipseLink logging, but I would guess you have a configuration issue. I don't know how or why EclipseLink would be given an 'unknown' connection while operating in a beforeCompletion callback, but it would get it from the connection pool you've configured it to use. Logging might give you more info on the steps leading up to this point and narrow down what might need to be configured differently.
Re: IllegalStateException, unknown connection on second transaction in request on JBoss EAP 7.3 serv [message #1837996 is a reply to message #1835595] Fri, 12 February 2021 11:40 Go to previous messageGo to next message
Geert-Jan Hut is currently offline Geert-Jan HutFriend
Messages: 5
Registered: September 2009
Junior Member
I have created a small test application (.war) which is deployable on a standard Wildfly instance. It shows that the issue only appears for native SQL queries (Named and direct), and only using a combination of CDI/EJB beans.

The database type is apparently not relevant, as I also get the exception logging using the standard H2 ExampleDS datasource that is configured in Wildfly.

The test application can be found here:

https://github.com/gjhut/eclipselink-IJ000311.git

The war can be build using maven and deployed in a standard Wildfly server. No additional configuration should be needed.

I am a bit lost how to proceed now, as I assume the issue has something to do with the JBoss/Eclipselink integration, but I could only make it occur with Native SQL queries.

[Updated on: Sat, 13 February 2021 06:55]

Report message to a moderator

Re: IllegalStateException, unknown connection on second transaction in request on JBoss EAP 7.3 serv [message #1838119 is a reply to message #1837996] Tue, 16 February 2021 16:18 Go to previous messageGo to next message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1388
Registered: July 2009
Senior Member
Searching for the error gives a number of hits on their solution page, but are protected requiring registration to view. I don't see why there should be any issue with EclipseLink returning a connection (best practice is to close it when done), but WildFly seems to be logging it as an INFO message; seems it should be taken up with them.
Re: IllegalStateException, unknown connection on second transaction in request on JBoss EAP 7.3 serv [message #1839322 is a reply to message #1838119] Fri, 19 March 2021 09:52 Go to previous message
Geert-Jan Hut is currently offline Geert-Jan HutFriend
Messages: 5
Registered: September 2009
Junior Member
Red Hat has indeed acknowledged this as an issue in the IronJacamar module in the application server. It has no impact on the transaction handling itself, and it is planned to be fixed in a future release.

See also: https://access.redhat.com/solutions/5893231
Previous Topic:EclipseLink 3.0 post-upgrade performance degradation
Next Topic:Load subentities with JPQL/EntitGraph is not working with EclipseLink
Goto Forum:
  


Current Time: Sat Jun 19 19:56:04 GMT 2021

Powered by FUDForum. Page generated in 0.01872 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top