-
Notifications
You must be signed in to change notification settings - Fork 236
Closed
Description
There is a transactional resource leak when using Spring Boot when spring.jpa.open-in-view=true which is the default setting when the async request times out which causes the entity manager to be closed by the OpenEntityManagerInViewInterceptor due to how PlatformJpaTransaction uses entityManager.isOpen as a condition before rolling back the transaction.
Subsequent requests using the thread will all fail when the JpaTransactionManager attempts to start a transaction as the ConnectionHolder is still bound to the thread local in TransactionSynchronizationManager.
org.springframework.transaction.IllegalTransactionStateException: Pre-bound JDBC Connection found! JpaTransactionManager does not support running within DataSourceTransactionManager if told to manage the DataSource itself. It is recommended to use a single JpaTransactionManager for all transactions on a single DataSource, no matter whether JPA or JDBC access.
Metadata
Metadata
Assignees
Labels
No labels