Joined: Mon Feb 20, 2017 2:15 am Posts: 1
|
We have a restful web application built on Spring + Hibernate framework. It is using multiple datasources and transaction manager for each of the datasource is set as org.springframework.orm.hibernate4.HibernateTransactionManager. All these are chained together in org.springframework.data.transaction.ChainedTransactionManager. We are enabling transaction using <tx:annotation-driven transaction-manager="transactionManager" /> and @Transactional annotations. Now the problem is that in one of our modules we are facing an exception as soon as a few requests are made. The exception stack is given below. This module is not using the default transactionManager, so we have explicitly set which transaction manager to use in @Transactional(value=”<moduleSpecificTransactionManager”). Has anyone come across this issue and found a solution for it? The version of hibernate and spring we are using are
hibernate.core.version - 4.3.11.Final hibernate.annotations.versions - 3.4.0.GA hibernate.validator.version - 5.1.1.Final spring.version - 4.2.0.RELEASE
Exception Trace: org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is java.lang.IllegalStateException: Already value [org.springframework.orm.hibernate4.SessionHolder@67c4bb38] for key [org.hibernate.internal.SessionFactoryImpl@16776931] bound to thread [[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)']; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is java.lang.IllegalStateException: Already value [org.springframework.orm.hibernate4.SessionHolder@67c4bb38] for key [org.hibernate.internal.SessionFactoryImpl@16776931] bound to thread [[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'] at org.springframework.data.transaction.ChainedTransactionManager.getTransaction(ChainedTransactionManager.java:122) at org.springframework.data.transaction.ChainedTransactionManager.getTransaction(ChainedTransactionManager.java:51) at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:427) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:276) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:653) Caused by: org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is java.lang.IllegalStateException: Already value [org.springframework.orm.hibernate4.SessionHolder@67c4bb38] for key [org.hibernate.internal.SessionFactoryImpl@16776931] bound to thread [[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'] at org.springframework.orm.hibernate4.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:544) at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373) at org.springframework.data.transaction.MultiTransactionStatus.registerTransactionManager(MultiTransactionStatus.java:68) at org.springframework.data.transaction.ChainedTransactionManager.getTransaction(ChainedTransactionManager.java:101) ... 77 more Caused by: java.lang.IllegalStateException: Already value [org.springframework.orm.hibernate4.SessionHolder@67c4bb38] for key [org.hibernate.internal.SessionFactoryImpl@16776931] bound to thread [[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'] at org.springframework.transaction.support.TransactionSynchronizationManager.bindResource(TransactionSynchronizationManager.java:190) at org.springframework.orm.hibernate4.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:524) ... 80 more
|
|