0 Replies Latest reply on May 2, 2018 7:37 AM by Jatin Kansagara

    javax.persistence.PersistenceException: org.hibernate.HibernateException: Transaction was rolled back in a different thread!

    Jatin Kansagara Newbie

      We have faced javax.persistence.PersistenceException: org.hibernate.HibernateException: Transaction was rolled back in a different thread! problem in wildfly 11

       

      2018-05-02 16:53:50.0347 ERROR EJB default - 2 com.nfdl.common.dao.GenericDAOImpl - find failed for Entity :- Class

      javax.persistence.PersistenceException: org.hibernate.HibernateException: Transaction was rolled back in a different thread!

      at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1692)

      at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1619)

      at org.hibernate.jpa.spi.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:1106)

      at org.hibernate.jpa.spi.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:1033)

      at org.jboss.as.jpa.container.AbstractEntityManager.find(AbstractEntityManager.java:213)

      at com.nfdl.common.dao.GenericDAOImpl.findById(GenericDAOImpl.java:76)

      at sun.reflect.GeneratedMethodAccessor71.invoke(Unknown Source)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

      at java.lang.reflect.Method.invoke(Method.java:498)

      at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:509)

      at org.jboss.as.weld.interceptors.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:90)

      at org.jboss.as.weld.interceptors.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:101)

      at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:40)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:53)

      at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:52)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:255)

      at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:334)

      at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:240)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:509)

      at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:64)

      at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:89)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:47)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:100)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.as.ejb3.deployment.processors.StartupAwaitInterceptor.processInvocation(StartupAwaitInterceptor.java:22)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:67)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:54)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:60)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:438)

      at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:609)

      at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:57)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:53)

      at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:198)

      at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:185)

      at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:81)

      at com.nfdl.bbpc.dao.BBPCDao$$$view5.findById(Unknown Source)

      at com.nfdl.bbpc.sms.service.AsyncSMSServiceImpl.sendRedeemSMS(AsyncSMSServiceImpl.java:47)

      at sun.reflect.GeneratedMethodAccessor89.invoke(Unknown Source)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

      at java.lang.reflect.Method.invoke(Method.java:498)

      at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:509)

      at org.jboss.as.weld.interceptors.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:90)

      at org.jboss.as.weld.interceptors.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:101)

      at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:40)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:53)

      at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:52)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:275)

      at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:332)

      at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:240)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:509)

      at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:73)

      at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:89)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:47)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:100)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.as.ejb3.deployment.processors.StartupAwaitInterceptor.processInvocation(StartupAwaitInterceptor.java:22)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:67)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:54)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:60)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:438)

      at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:609)

      at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:57)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:53)

      at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:198)

      at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:185)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.as.ejb3.component.interceptors.LogDiagnosticContextRecoveryInterceptor.processInvocation(LogDiagnosticContextRecoveryInterceptor.java:82)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)

      at org.jboss.as.ejb3.component.interceptors.AsyncFutureInterceptorFactory$2$2.runInvocation(AsyncFutureInterceptorFactory.java:152)

      at org.jboss.as.ejb3.component.interceptors.AsyncInvocationTask.run(AsyncInvocationTask.java:81)

      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

      at java.lang.Thread.run(Thread.java:745)

      at org.jboss.threads.JBossThread.run(JBossThread.java:320)

      Caused by: org.hibernate.HibernateException: Transaction was rolled back in a different thread!

      at org.hibernate.resource.transaction.backend.jta.internal.synchronization.SynchronizationCallbackCoordinatorTrackingImpl.processAnyDelayedAfterCompletion(SynchronizationCallbackCoordinatorTrackingImpl.java:90)

      at org.hibernate.internal.SessionImpl.delayedAfterCompletion(SessionImpl.java:630)

      at org.hibernate.internal.SessionImpl.checkTransactionSynchStatus(SessionImpl.java:2232)

      at org.hibernate.internal.SessionImpl.isTransactionInProgress(SessionImpl.java:503)

      at org.hibernate.internal.SessionImpl.afterOperation(SessionImpl.java:544)

      at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.doLoad(SessionImpl.java:2769)

      at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.load(SessionImpl.java:2741)

      at org.hibernate.internal.SessionImpl.get(SessionImpl.java:978)

      at org.hibernate.jpa.spi.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:1075)

      ... 127 more

       

      Datasource as below.

      <datasource jta="true" jndi-name="java:jboss/datasource/oracleDS" pool-name="oracle" enabled="true" spy="true" use-ccm="true" statistics-enabled="true">

                              <connection-url>jdbc:oracle:thin:@x.x.x.x:1521:Test</connection-url>

                              <driver>oracle</driver>

                              <pool>

                                  <min-pool-size>10</min-pool-size>

                                  <initial-pool-size>10</initial-pool-size>

                                  <max-pool-size>200</max-pool-size>

                                  <prefill>true</prefill>

                                  <use-strict-min>true</use-strict-min>

                              </pool>

                              <security>

                                  <user-name>test</user-name>

                                  <password>test</password>

                              </security>

                              <validation>

                                  <check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>

                                  <validate-on-match>true</validate-on-match>

                                  <background-validation>true</background-validation>

                                  <background-validation-millis>10000</background-validation-millis>

                              </validation>

                              <timeout>

                                  <idle-timeout-minutes>15</idle-timeout-minutes>

                              </timeout>

                          </datasource>