mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2025-01-19 11:40:05 +08:00
修复 activiti 事务的一致性
This commit is contained in:
parent
fcd44d8b0d
commit
ec876d54a4
@ -43,12 +43,10 @@
|
|||||||
<artifactId>yudao-spring-boot-starter-security</artifactId>
|
<artifactId>yudao-spring-boot-starter-security</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- DB 相关 -->
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.mybatis</groupId>
|
<groupId>cn.iocoder.boot</groupId>
|
||||||
<artifactId>mybatis</artifactId>
|
<artifactId>yudao-spring-boot-starter-mybatis</artifactId>
|
||||||
<optional>true</optional>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--使用mybatis plus需排除掉mybatis-->
|
<!--使用mybatis plus需排除掉mybatis-->
|
||||||
|
@ -4,9 +4,15 @@ import cn.iocoder.yudao.framework.activiti.core.web.ActivitiWebFilter;
|
|||||||
import cn.iocoder.yudao.framework.common.enums.WebFilterOrderEnum;
|
import cn.iocoder.yudao.framework.common.enums.WebFilterOrderEnum;
|
||||||
import org.activiti.image.ProcessDiagramGenerator;
|
import org.activiti.image.ProcessDiagramGenerator;
|
||||||
import org.activiti.image.impl.DefaultProcessDiagramGenerator;
|
import org.activiti.image.impl.DefaultProcessDiagramGenerator;
|
||||||
|
import org.activiti.spring.SpringProcessEngineConfiguration;
|
||||||
|
import org.activiti.spring.boot.ProcessEngineConfigurationConfigurer;
|
||||||
|
import org.apache.ibatis.session.SqlSessionFactory;
|
||||||
|
import org.apache.ibatis.transaction.TransactionFactory;
|
||||||
|
import org.mybatis.spring.transaction.SpringManagedTransactionFactory;
|
||||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.transaction.PlatformTransactionManager;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
public class YudaoActivitiConfiguration {
|
public class YudaoActivitiConfiguration {
|
||||||
@ -27,4 +33,13 @@ public class YudaoActivitiConfiguration {
|
|||||||
return registrationBean;
|
return registrationBean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ProcessEngineConfigurationConfigurer 实现类,设置事务管理器,保证 ACT_ 表和自己的表的事务一致性
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public ProcessEngineConfigurationConfigurer processEngineConfigurationConfigurer(
|
||||||
|
PlatformTransactionManager platformTransactionManager) {
|
||||||
|
return processEngineConfiguration -> processEngineConfiguration.setTransactionManager(platformTransactionManager);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user