From bb83e54c000e784ee74dbbc6fddabe8a24ab1396 Mon Sep 17 00:00:00 2001 From: Giheon Do Date: Thu, 17 Jul 2025 14:21:56 +0900 Subject: [PATCH 1/3] Correct the default value of nestedTransactionAllowed in Javadoc Signed-off-by: Giheon Do --- .../org/springframework/orm/jpa/JpaTransactionManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-orm/src/main/java/org/springframework/orm/jpa/JpaTransactionManager.java b/spring-orm/src/main/java/org/springframework/orm/jpa/JpaTransactionManager.java index a452992632c0..7cb53fa94c43 100644 --- a/spring-orm/src/main/java/org/springframework/orm/jpa/JpaTransactionManager.java +++ b/spring-orm/src/main/java/org/springframework/orm/jpa/JpaTransactionManager.java @@ -93,9 +93,9 @@ * *

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 + * to {@code true} 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 + * context. You can manually set the flag to {@code false} if you want to disallow nested * transactions for JDBC access code which participates in JPA transactions (provided * that your JDBC driver supports Savepoints). Note that JPA itself does not support * nested transactions! Hence, do not expect JPA access code to semantically From 9d28e4542a379204d5f998f4d9e99502d541cf16 Mon Sep 17 00:00:00 2001 From: Giheon Do Date: Mon, 21 Jul 2025 15:43:20 +0900 Subject: [PATCH 2/3] Clarify limitations of nested transactions in Javadoc Signed-off-by: Giheon Do --- .../org/springframework/orm/jpa/JpaTransactionManager.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spring-orm/src/main/java/org/springframework/orm/jpa/JpaTransactionManager.java b/spring-orm/src/main/java/org/springframework/orm/jpa/JpaTransactionManager.java index 7cb53fa94c43..02c7340cab5f 100644 --- a/spring-orm/src/main/java/org/springframework/orm/jpa/JpaTransactionManager.java +++ b/spring-orm/src/main/java/org/springframework/orm/jpa/JpaTransactionManager.java @@ -93,12 +93,14 @@ * *

This transaction manager supports nested transactions via JDBC Savepoints. * The {@link #setNestedTransactionAllowed "nestedTransactionAllowed"} flag defaults - * to {@code true} though, since nested transactions will just apply to the JDBC + * to {@code true}, but 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 false} if you want to disallow nested * transactions for JDBC access code which participates in JPA transactions (provided * that your JDBC driver supports Savepoints). Note that JPA itself does not support - * nested transactions! Hence, do not expect JPA access code to semantically + * nested transactions! Furthermore, as most JPA providers (e.g., Hibernate) + * do not support savepoints, {@code Propagation.NESTED} will not work and will typically + * result in an exception. Hence, do not expect JPA access code to semantically * participate in a nested transaction. * * @author Juergen Hoeller From 05a59ad7b602f04647e13b393b546c50241e0b05 Mon Sep 17 00:00:00 2001 From: Giheon Do Date: Mon, 21 Jul 2025 21:31:34 +0900 Subject: [PATCH 3/3] Simplify Javadoc on nested transaction support in JpaTransactionManager Signed-off-by: Giheon Do --- .../org/springframework/orm/jpa/JpaTransactionManager.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/spring-orm/src/main/java/org/springframework/orm/jpa/JpaTransactionManager.java b/spring-orm/src/main/java/org/springframework/orm/jpa/JpaTransactionManager.java index 02c7340cab5f..999d1115ce0b 100644 --- a/spring-orm/src/main/java/org/springframework/orm/jpa/JpaTransactionManager.java +++ b/spring-orm/src/main/java/org/springframework/orm/jpa/JpaTransactionManager.java @@ -98,9 +98,7 @@ * context. You can manually set the flag to {@code false} if you want to disallow nested * transactions for JDBC access code which participates in JPA transactions (provided * that your JDBC driver supports Savepoints). Note that JPA itself does not support - * nested transactions! Furthermore, as most JPA providers (e.g., Hibernate) - * do not support savepoints, {@code Propagation.NESTED} will not work and will typically - * result in an exception. Hence, do not expect JPA access code to semantically + * nested transactions! Hence, do not expect JPA access code to semantically * participate in a nested transaction. * * @author Juergen Hoeller