Improve wording for transactional rollback rule semantics

Closes gh-35346
This commit is contained in:
Sam Brannen
2025-08-19 13:32:35 +02:00
parent 68762b5f86
commit 5d325ca0fc
2 changed files with 13 additions and 8 deletions
@@ -56,9 +56,12 @@ import org.springframework.transaction.TransactionDefinition;
* {@link #rollbackForClassName}/{@link #noRollbackForClassName}, which allow
* rules to be specified as types or patterns, respectively.
*
* <p>When a rollback rule is defined with an exception type, that type will be
* used to match against the type of a thrown exception and its super types,
* providing type safety and avoiding any unintentional matches that may occur
* <p>When a rollback rule is defined with an exception type &mdash; for example,
* via {@link #rollbackFor} &mdash; that type will be used to match against the
* type of a thrown exception. Specifically, given a configured exception type
* {@code C}, a thrown exception of type {@code T} will be considered a match
* against {@code C} if {@code T} is equal to {@code C} or a subclass of {@code C}.
* This provides type safety and avoids any unintentional matches that may occur
* when using a pattern. For example, a value of
* {@code jakarta.servlet.ServletException.class} will only match thrown exceptions
* of type {@code jakarta.servlet.ServletException} and its subclasses.