mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-17 16:39:29 +00:00
Clarify intended nestedTransactionAllowed default in JpaTransactionManager
Closes gh-35212
This commit is contained in:
+2
-2
@@ -88,12 +88,12 @@ import org.springframework.util.Assert;
|
||||
* such a scenario (see container setup).
|
||||
*
|
||||
* <p>This transaction manager supports nested transactions via JDBC Savepoints.
|
||||
* The {@link #setNestedTransactionAllowed} "nestedTransactionAllowed"} flag defaults
|
||||
* The {@link #setNestedTransactionAllowed "nestedTransactionAllowed"} flag defaults
|
||||
* to "false", though, as nested transactions will just apply to the JDBC Connection,
|
||||
* not to the Hibernate Session and its cached entity objects and related context.
|
||||
* You can manually set the flag to "true" if you want to use nested transactions
|
||||
* for JDBC access code which participates in Hibernate transactions (provided that
|
||||
* your JDBC driver supports Savepoints). <i>Note that Hibernate itself does not
|
||||
* your JDBC driver supports savepoints). <i>Note that Hibernate itself does not
|
||||
* support nested transactions! Hence, do not expect Hibernate access code to
|
||||
* semantically participate in a nested transaction.</i>
|
||||
*
|
||||
|
||||
@@ -93,13 +93,14 @@ import org.springframework.util.CollectionUtils;
|
||||
*
|
||||
* <p>This transaction manager supports nested transactions via JDBC Savepoints.
|
||||
* The {@link #setNestedTransactionAllowed "nestedTransactionAllowed"} flag defaults
|
||||
* to {@code false} though, since nested transactions will just apply to the JDBC
|
||||
* Connection, not to the JPA EntityManager and its cached entity objects and related
|
||||
* context. You can manually set the flag to {@code true} if you want to use nested
|
||||
* transactions for JDBC access code which participates in JPA transactions (provided
|
||||
* that your JDBC driver supports Savepoints). <i>Note that JPA itself does not support
|
||||
* nested transactions! Hence, do not expect JPA access code to semantically
|
||||
* participate in a nested transaction.</i>
|
||||
* to "true" but should rather be "false", as nested transactions will just apply to
|
||||
* the JDBC Connection, not to the JPA EntityManager and its cached entity objects
|
||||
* and related context. As of Spring Framework 7.0, the default will be "false" in
|
||||
* alignment with other transaction managers, requiring an explicit switch to "true"
|
||||
* if you want to use nested transactions for JDBC access code which participates
|
||||
* in JPA transactions (provided that your JDBC driver supports savepoints).
|
||||
* <i>Note that JPA itself does not support nested transactions! Hence, do not
|
||||
* expect JPA access code to semantically participate in a nested transaction.</i>
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 2.0
|
||||
|
||||
Reference in New Issue
Block a user