Files
spring-framework/spring-orm
Rene Schakmann 912b0bce9d Improve pre-bound JDBC Connection exception message
Prior to this commit, JpaTransactionManager and
HibernateTransactionManager stated that they do not support "running
within DataSourceTransactionManager" when encountering a pre-bound
JDBC Connection that is not synchronized with a transaction.

However, DataSourceTransactionManager marks its ConnectionHolder as
synchronized with the transaction and therefore does not trigger this
check. Instead, the exception is typically caused by another
JpaTransactionManager or HibernateTransactionManager for a different
persistence unit exposing a JDBC Connection for the same DataSource,
or by a JDBC Connection that has been left bound to the current
thread.

This commit revises the exception message accordingly so that it no
longer points to DataSourceTransactionManager.

See gh-14130
Closes gh-37356

Signed-off-by: rene.schakmann <rene.schakmann@reetgroup.com>
2026-10-02 15:33:49 +02:00
..