Skip to content

Commit 04af30d

Browse files
committed
JPA/Hibernate docs: transaction management, JTA setup
Issue: SPR-14957 (cherry picked from commit 2f80b84)
1 parent 5ccc8e3 commit 04af30d

File tree

2 files changed

+99
-232
lines changed

2 files changed

+99
-232
lines changed

spring-orm/src/main/java/org/springframework/orm/jpa/vendor/HibernateJpaVendorAdapter.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,16 @@ public HibernateJpaVendorAdapter() {
108108
* JDBC Connection.
109109
* <p>See {@link HibernateJpaDialect#setPrepareConnection(boolean)} for details.
110110
* This is just a convenience flag passed through to {@code HibernateJpaDialect}.
111-
* <p>On Hibernate 5.2, this flag remains {@code true} by default like against
111+
* <p>On Hibernate 5.1/5.2, this flag remains {@code true} by default like against
112112
* previous Hibernate versions. The vendor adapter manually enforces Hibernate's
113113
* new connection handling mode {@code DELAYED_ACQUISITION_AND_HOLD} in that case
114114
* unless a user-specified connection handling mode property indicates otherwise;
115115
* switch this flag to {@code false} to avoid that interference.
116+
* <p><b>NOTE: Per the explanation above, you may have to turn this flag off
117+
* when using Hibernate in a JTA environment, e.g. on WebLogic.</b> Alternatively,
118+
* set Hibernate 5.2's "hibernate.connection.handling_mode" property to
119+
* "DELAYED_ACQUISITION_AND_RELEASE_AFTER_TRANSACTION" or even
120+
* "DELAYED_ACQUISITION_AND_RELEASE_AFTER_STATEMENT" in such a scenario.
116121
* @since 4.3.1
117122
* @see #getJpaPropertyMap()
118123
* @see HibernateJpaDialect#beginTransaction

0 commit comments

Comments
 (0)