修复 activiti 事务的一致性
This commit is contained in:
parent
fcd44d8b0d
commit
ec876d54a4
@ -43,12 +43,10 @@
|
||||
<artifactId>yudao-spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
<!-- DB 相关 -->
|
||||
<dependency>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis</artifactId>
|
||||
<optional>true</optional>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-mybatis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--使用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 org.activiti.image.ProcessDiagramGenerator;
|
||||
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.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
|
||||
@Configuration
|
||||
public class YudaoActivitiConfiguration {
|
||||
@ -27,4 +33,13 @@ public class YudaoActivitiConfiguration {
|
||||
return registrationBean;
|
||||
}
|
||||
|
||||
/**
|
||||
* ProcessEngineConfigurationConfigurer 实现类,设置事务管理器,保证 ACT_ 表和自己的表的事务一致性
|
||||
*/
|
||||
@Bean
|
||||
public ProcessEngineConfigurationConfigurer processEngineConfigurationConfigurer(
|
||||
PlatformTransactionManager platformTransactionManager) {
|
||||
return processEngineConfiguration -> processEngineConfiguration.setTransactionManager(platformTransactionManager);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user