Does HibernateOptimisticLockingFailureException mark a connection as "closed"?

I get the following stack trace:

org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException: Object of class [com.btfin.wrapcore.request.MFRequest] with identifier [2850448]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [com.btfin.wrapcore.request.MFRequest#2850448]
  at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:672)
  at org.springframework.orm.hibernate3.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:793)

This is due to the optimistic exclusion of blocking. I can solve this reason.

My question is - in this case, the exception handling establishes a connection to the database "closed". (Which causes problems with my connection pool).

What is the pattern for handling a database exception, for example HibernateOptimisticLockingFailureException, that bubbles through spring and sleep and returns a closed connection?

Do you know the part of Spring / Hibernate code that establishes a connection to a closed one?

+5
source share
1 answer

Hibernate Docs , - , . , - , .

, close(), :

, , .

, , , Hibernate Spring - , close(), , .

+4

All Articles