Transaction do not rollback when working with MultiSchemaConfiguration

hi, here is my testing code:

@Transactional(rollbackFor = RuntimeException.class)
public void testTransaction(String taskId) {
tenantInfoHolder.setCurrentTenantId(“abe”);
taskService.complete(taskId);
tenantInfoHolder.clearCurrentTenantId();
throw new RuntimeException(“test transaction when fail”);
}

I wonder why task do not rollback when use MultiSchemaMultiTenantProcessEngineConfiguration , but SpringProcessEngineConfiguration can be work well, anyone any ideas?

below is my config:

@Bean
public TenantAwareDataSource tenantAwareDatasource(TenantInfoHolder tenantInfoHolder) {
TenantAwareDataSource tenantAwareDatasource = new TenantAwareDataSource(tenantInfoHolder);
return tenantAwareDatasource;
}

@Bean
@ConditionalOnClass(TenantAwareDataSource.class)
public MultiSchemaMultiTenantProcessEngineConfiguration multiSchemaProcessEngineConfiguration(
		ApplicationContext applicationContext,
		TenantAwareDataSource tenantAwareDataSource, PlatformTransactionManager transactionManager){
	MultiSchemaMultiTenantProcessEngineConfiguration cfg = new MultiSchemaMultiTenantProcessEngineConfiguration(tenantInfoHolder);
	cfg.setDatabaseType(MultiSchemaMultiTenantProcessEngineConfiguration.DATABASE_TYPE_MYSQL);
	cfg.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);
	cfg.setAsyncExecutorActivate(true);
	cfg.setFallbackToDefaultTenant(false);
	cfg.setDisableIdmEngine(true);
	cfg.setTransactionsExternallyManaged(true);
	cfg.setDataSource(tenantAwareDataSource);
	cfg.setExpressionManager(new SpringExpressionManager(applicationContext, cfg.getBeans()));
	cfg.setBeans(new SpringBeanFactoryProxyMap(applicationContext));
	return cfg;
}

thanks for anyone help

Can you elaborate what you see? You mean the task is completed? Can you share your full test?

thanks for reply!

here is my testing code:

@Controller
public class TaskController {

@Autowired
private TestService testService;

/**
 * rest request entrance
 * @param taskId
 * @param request
 * @return
 */
@RequestMapping(value="task/single/{taskId}")
@ResponseBody
public String completeTask(@PathVariable("taskId") String taskId, HttpServletRequest request) {
	testService.testTransaction(taskId);
	return "success";
}

}

@Service
public class TestService {

@Autowired
private TaskService taskService;
@Autowired
private TenantInfoHolder tenantInfoHolder;

/**
 * task success completed even transaction has rolled back
 * @param taskId
 */
@Transactional(rollbackFor = RuntimeException.class) // task do not rollback and completed success
public void testTransaction(String taskId) {
	tenantInfoHolder.setCurrentTenantId("abe");
	taskService.complete(taskId); 
	tenantInfoHolder.clearCurrentTenantId();
	// test whether the transaction is rolled back 
	throw new RuntimeException("test transaction when fail"); 
}

}