File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
hsweb-commons/hsweb-commons-crud/src/main/java/org/hswebframework/web/crud/utils Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,9 @@ public class TransactionUtils {
2222
2323 static TransactionManager transactionManager ;
2424
25+ static final DefaultTransactionDefinition PROPAGATION_REQUIRES_NEW_DEF
26+ = new DefaultTransactionDefinition (PROPAGATION_REQUIRES_NEW );
27+
2528 public static void setup (TransactionManager transactionManager ) {
2629 TransactionUtils .transactionManager = transactionManager ;
2730 }
@@ -54,7 +57,8 @@ public static Mono<Void> afterCommit(Mono<Void> task) {
5457 @ Override
5558 @ NonNull
5659 public Mono <Void > afterCommit () {
57- return tryRunInTransaction (task , new DefaultTransactionDefinition (PROPAGATION_REQUIRES_NEW ));
60+ // 开启新事务
61+ return tryRunInTransaction (task , PROPAGATION_REQUIRES_NEW_DEF );
5862 }
5963 },
6064 TransactionSynchronization ::afterCommit
You can’t perform that action at this time.
0 commit comments