diff --git a/spring-tx/src/main/java/org/springframework/transaction/reactive/TransactionContextManager.java b/spring-tx/src/main/java/org/springframework/transaction/reactive/TransactionContextManager.java index 900fba8cd85d..cac1f04133c7 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/reactive/TransactionContextManager.java +++ b/spring-tx/src/main/java/org/springframework/transaction/reactive/TransactionContextManager.java @@ -37,9 +37,6 @@ */ public abstract class TransactionContextManager { - private static final NoTransactionInContextException NO_TRANSACTION_IN_CONTEXT_EXCEPTION = - new NoTransactionInContextException(); - private TransactionContextManager() { } @@ -63,7 +60,7 @@ public static Mono currentContext() { return Mono.just(holder.currentContext()); } } - return Mono.error(NO_TRANSACTION_IN_CONTEXT_EXCEPTION); + return Mono.error(new NoTransactionInContextException()); }); }