mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-25 16:29:28 +00:00
Improve wording for transactional rollback rule semantics
Closes gh-35346
This commit is contained in:
+6
-3
@@ -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 — for example,
|
||||
* via {@link #rollbackFor} — 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.
|
||||
|
||||
Reference in New Issue
Block a user