I have an OpenSessionInViewInterceptor in my application, And a service class method calling DAO methods. All my DAO methods are transactional with PROPOGATION_REQUIRED.
Lets say there are about 10 calls to different dao methods inside a single service method, but the service method is not transactional.
I assume since OpenSessionInViewInterceptor is in action. A single session will be used and transactions are wrapped around each dao method call. But it is not consistent. HibernateTransactionManager randomly creates new sessions for some method calls and for some it doesnt
See my logIn the third method call i dont understand why it needs a new session, all of these methods are declared as PROPOGATION_REQUIREDCode:-Found thread-bound Session [org.hibernate.impl.SessionImpl@188e490] for Hibernate transaction - Creating new transaction with name [com.bmc.dao.MemberDAO.findBrokersDfltMember]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT - Preparing JDBC Connection of Hibernate Session [org.hibernate.impl.SessionImpl@188e490] -Found thread-bound Session [org.hibernate.impl.SessionImpl@188e490] for Hibernate transaction - Creating new transaction with name [com.bmc.dao.PlanDAO.getPlan]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT - Preparing JDBC Connection of Hibernate Session [org.hibernate.impl.SessionImpl@188e490] -Found thread-bound Session [org.hibernate.impl.SessionImpl@188e490] for Hibernate transaction - Creating new transaction with name [com.bmc.dao.MemberDAO.saveMemberChange]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT - Opened new Session [org.hibernate.impl.SessionImpl@3457f1] for Hibernate transaction - Preparing JDBC Connection of Hibernate Session [org.hibernate.impl.SessionImpl@3457f1]
Thanks in advance


Reply With Quote
