Hi Everyone,
According to the documentation here
When passing the DataSource to the
SpringProcessEngineConfiguration
(using property “dataSource”), Flowable uses aorg.springframework.jdbc.datasource.TransactionAwareDataSourceProxy
internally, which wraps the passed DataSource. This is done to make sure the SQL connections retrieved from the DataSource and the Spring transactions play well together
I have a application embedding Flowable engine and my configuration look like this
@Configuration
public class ProcessEngineConfig {
@Autowired
private DataSource dataSource;
@Autowired
private PlatformTransactionManager transactionManager;
@Bean
public ProcessEngineConfigurationImpl processEngineConfiguration() {
SpringProcessEngineConfiguration config = new SpringProcessEngineConfiguration();
config.setDataSource(dataSource);
config.setTransactionManager(transactionManager);
config.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);
return config;
}
@Bean
public ProcessEngine processEngine() {
ProcessEngine processEngine = processEngineConfiguration().buildProcessEngine();
return processEngine;
}
@Bean
public RepositoryService repositoryService() {
return processEngine().getRepositoryService();
}
@Bean
public RuntimeService runtimeService() {
return processEngine().getRuntimeService();
}
@Bean
public HistoryService historyService() {
return processEngine().getHistoryService();
}
@Bean
public ManagementService managementService() {
return processEngine().getManagementService();
}
I continually have this exception thrown when having task executed back to back
org.flowable.common.engine.api.FlowableOptimisticLockingException: HistoricTaskInstanceEntity[id=17669] was updated by another transaction concurrently
Could someone help ?