From b8408a9b31bac03576297a75b5ceb67c5dd3aa71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=80=E6=BA=90=E6=B5=B7=E5=93=A5?= Date: Mon, 15 May 2023 13:23:38 +0800 Subject: [PATCH] update docs --- docs/zh/core/tx.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/zh/core/tx.md b/docs/zh/core/tx.md index b9acc4e6..c4b7e587 100644 --- a/docs/zh/core/tx.md +++ b/docs/zh/core/tx.md @@ -73,10 +73,12 @@ Db.tx(() -> { ## @Transactional -Mybatis-Flex 已支持 Spring 框架的 `@Transactional`,在使用 Spring 的情况下,可以使用 `@Transactional` 进行事务管理。 - +Mybatis-Flex 已支持 Spring 框架的 `@Transactional`,在使用 SpringBoot 的情况下,可以直接使用 `@Transactional` 进行事务管理。 同理,使用 Spring 的 `TransactionTemplate` 进行事务管理也是没问题的。 +> 注意:若项目未使用 SpringBoot,只用到了 Spring,需要参考 MyBatis-Flex 的 [FlexTransactionAutoConfiguration](https://gitee.com/mybatis-flex/mybatis-flex/blob/main/mybatis-flex-spring-boot-starter/src/main/java/com/mybatisflex/spring/boot/FlexTransactionAutoConfiguration.java) +> 进行事务配置,才能正常使用 `@Transactional` 注解。 + ## 特征 - 1、支持嵌套事务