You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We experienced deadlocks in our product while load testing. The issue occurs when mixing Hibernate Sessions with JdbcTemplate code. What basically happens:
The session in view filter creates a new Hibernate Session.
The HibernateTransactionManager registers a JDBC datasource in the thread local map using the real class.
Somewhere in a service call (and transaction) the user details are requested via the JdbcUserDetailsManager (from spring security) which is implemented as a JdbcTemplate. The JdbcTemplate has a JDK proxy of the datasource. This leads to a lookup in the thread local map with the proxy in stead of the real data source. Since TransactionSynchronizationUtils.unwrapResourceIfNecessary() does not unwrap JDK proxies the lookup fails. As a result the existing connection is not reused and a new connection is requested from the connection pool.
This deadlocks when the connection pool has no connections left.
(Checked the code up to 3.0.3 Release in which this is also present)
Affects: 3.0 GA
The text was updated successfully, but these errors were encountered:
Ric Klaren opened SPR-7368 and commented
We experienced deadlocks in our product while load testing. The issue occurs when mixing Hibernate Sessions with JdbcTemplate code. What basically happens:
This deadlocks when the connection pool has no connections left.
(Checked the code up to 3.0.3 Release in which this is also present)
Affects: 3.0 GA
The text was updated successfully, but these errors were encountered: