mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-10-09 16:49:36 +00:00
Polish contribution
See gh-37356
This commit is contained in:
@@ -387,15 +387,11 @@ public class JpaTransactionManager extends AbstractPlatformTransactionManager
|
||||
JpaTransactionObject txObject = (JpaTransactionObject) transaction;
|
||||
|
||||
if (txObject.hasConnectionHolder() && !txObject.getConnectionHolder().isSynchronizedWithTransaction()) {
|
||||
throw new IllegalTransactionStateException(
|
||||
"Pre-bound JDBC Connection found! JpaTransactionManager does not support " +
|
||||
"running within another transaction manager that exposes a JDBC Connection " +
|
||||
"for the same DataSource (for example, a JpaTransactionManager or " +
|
||||
"HibernateTransactionManager for a different persistence unit) if told to " +
|
||||
"manage the DataSource itself. Alternatively, a JDBC Connection may have been " +
|
||||
"left bound to the current thread. It is recommended to use a single " +
|
||||
"JpaTransactionManager for all transactions on a single DataSource, " +
|
||||
"no matter whether JPA or JDBC access.");
|
||||
throw new IllegalTransactionStateException("""
|
||||
Pre-bound JDBC Connection found! JpaTransactionManager does not support running within \
|
||||
another transaction manager that exposes a JDBC Connection for the same DataSource \
|
||||
(or after a leaked Connection binding) if told to manage the DataSource itself. \
|
||||
Use a single JpaTransactionManager for all transactions on a single DataSource.""");
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
+5
-9
@@ -443,15 +443,11 @@ public class HibernateTransactionManager extends AbstractPlatformTransactionMana
|
||||
HibernateTransactionObject txObject = (HibernateTransactionObject) transaction;
|
||||
|
||||
if (txObject.hasConnectionHolder() && !txObject.getConnectionHolder().isSynchronizedWithTransaction()) {
|
||||
throw new IllegalTransactionStateException(
|
||||
"Pre-bound JDBC Connection found! HibernateTransactionManager does not support " +
|
||||
"running within another transaction manager that exposes a JDBC Connection " +
|
||||
"for the same DataSource (for example, a HibernateTransactionManager or " +
|
||||
"JpaTransactionManager for a different SessionFactory) if told to manage " +
|
||||
"the DataSource itself. Alternatively, a JDBC Connection may have been " +
|
||||
"left bound to the current thread. It is recommended to use a single " +
|
||||
"HibernateTransactionManager for all transactions on a single DataSource, " +
|
||||
"no matter whether Hibernate or JDBC access.");
|
||||
throw new IllegalTransactionStateException("""
|
||||
Pre-bound JDBC Connection found! HibernateTransactionManager does not support running within \
|
||||
another transaction manager that exposes a JDBC Connection for the same DataSource \
|
||||
(or after a leaked Connection binding) if told to manage the DataSource itself. \
|
||||
Use a single HibernateTransactionManager for all transactions on a single DataSource.""");
|
||||
}
|
||||
|
||||
SessionImplementor session = null;
|
||||
|
||||
Reference in New Issue
Block a user