Skip to content

Commit 2f80b84

Browse files
committed
JPA/Hibernate docs: transaction management, JTA setup
Issue: SPR-14957
1 parent 05579fd commit 2f80b84

File tree

2 files changed

+102
-234
lines changed

2 files changed

+102
-234
lines changed

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

+6-1
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,16 @@ public HibernateJpaVendorAdapter() {
7878
* JDBC Connection.
7979
* <p>See {@link HibernateJpaDialect#setPrepareConnection(boolean)} for details.
8080
* This is just a convenience flag passed through to {@code HibernateJpaDialect}.
81-
* <p>On Hibernate 5.2, this flag remains {@code true} by default like against
81+
* <p>On Hibernate 5.1/5.2, this flag remains {@code true} by default like against
8282
* previous Hibernate versions. The vendor adapter manually enforces Hibernate's
8383
* new connection handling mode {@code DELAYED_ACQUISITION_AND_HOLD} in that case
8484
* unless a user-specified connection handling mode property indicates otherwise;
8585
* switch this flag to {@code false} to avoid that interference.
86+
* <p><b>NOTE: Per the explanation above, you may have to turn this flag off
87+
* when using Hibernate in a JTA environment, e.g. on WebLogic.</b> Alternatively,
88+
* set Hibernate 5.2's "hibernate.connection.handling_mode" property to
89+
* "DELAYED_ACQUISITION_AND_RELEASE_AFTER_TRANSACTION" or even
90+
* "DELAYED_ACQUISITION_AND_RELEASE_AFTER_STATEMENT" in such a scenario.
8691
* @since 4.3.1
8792
* @see #getJpaPropertyMap()
8893
* @see HibernateJpaDialect#beginTransaction

0 commit comments

Comments
 (0)