cancel
Showing results for 
Search instead for 
Did you mean: 

Transaction propagation issues

drams
Champ in-the-making
Champ in-the-making
We are using two seperate (XA) datasources, one with our business data and one with our Activiti scheme.
We are passing the same JTA transaction manager to Activti through the SpringProcessEngineConfiguration.

It seems that Activiti is creating a new transaction when starting a workflow so we can't see that data that is already persisted in the running transaction.

How can we force Activiti to use the current existing transaction? 
We are running on a JBoss 5.2 platform and using an Oracle database.

Our configuration:


@Inject
  @Named("dataSourceBpm")
  private DataSource dataSourceBpm;

  @Bean
  public SpringProcessEngineConfiguration processEngineConfiguration() {
    SpringProcessEngineConfiguration processEngineConfiguration = new SpringProcessEngineConfiguration();

    processEngineConfiguration.setDataSource(dataSourceBpm);
    processEngineConfiguration.setTransactionManager(transactionManager);
    processEngineConfiguration.setDatabaseSchemaUpdate("true");
    processEngineConfiguration.setJobExecutorActivate(true);
    processEngineConfiguration.setTransactionsExternallyManaged(true);

    processEngineConfiguration.setHistoryLevel(HistoryLevel.AUDIT);
    return processEngineConfiguration;
  }
4 REPLIES 4

frederikherema1
Star Contributor
Star Contributor
Have you tried using the JTAProcessEngineCOnfiguration instead?

jbarrez
Star Contributor
Star Contributor
It should simple work. If you put @transactional around the method invoking the startProcessInstance() call, it uses that transaction.

drams
Champ in-the-making
Champ in-the-making
Thank you for your response guys.

we were too focussed on the transactions. The parent transaction was being used as expected but the problem was in another part of our application not related to Activti.

frederikherema1
Star Contributor
Star Contributor
Great to see it's working as expected Smiley Wink