<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Multiple Data sources in activiti in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/multiple-data-sources-in-activiti/m-p/245521#M198651</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have written a spring boot application. I have a two data sources - one is used by activiti engine for it's database and another datasource for updating my tables. The database updates to my tables are done in the event listeners. I have configured both the data sources as follows. The code is working fine but I do sense that there may be issues here as the same default transaction manager is used by activiti engine to update it's tables and also to update my tables. This transaction manager is the JpaTransactionManager. The datasource field in the transactionmanager is pointing to my database as I have defined it as primary. The transactionfactory defined in SpringProcessEngineConfiguration is pointing to activiti datasource. The transactionFactory is used by the DbSqlSession in mybatis. I am trying to understand how Spring is updating the tables properly here as the datasources are different in both the cases. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code language="java"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;@Configuration&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;public class ActivitiConfiguration extends AbstractProcessEngineAutoConfiguration {&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;@Primary&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;@Bean(name = "myDataSource")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;@ConfigurationProperties(prefix = "spring.datasource.mine")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public DataSource getMyDataSource() {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return DataSourceBuilder.create().build();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;@Bean(name = "activitiDataSource")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;@ConfigurationProperties(prefix = "spring.datasource.activiti")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public DataSource getActivitiDataSource() {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return DataSourceBuilder.create().build();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;@Primary&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;@Bean(name = "transactionManager")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public PlatformTransactionManager transactionManager(@Qualifier("myDataSource") DataSource dataSource) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;JpaTransactionManager transactionManager = new JpaTransactionManager();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;transactionManager.setDataSource(dataSource);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return transactionManager;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;@Bean&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public SpringProcessEngineConfiguration springProcessEngineConfiguration(PlatformTransactionManager activitiTransactionManager,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SpringAsyncExecutor springAsyncExecutor, @Qualifier("activitiDataSource") DataSource dataSource) throws IOException {&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return baseSpringProcessEngineConfiguration(dataSource, activitiTransactionManager, springAsyncExecutor);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Jun 2016 19:11:05 GMT</pubDate>
    <dc:creator>davanna</dc:creator>
    <dc:date>2016-06-20T19:11:05Z</dc:date>
    <item>
      <title>Multiple Data sources in activiti</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/multiple-data-sources-in-activiti/m-p/245521#M198651</link>
      <description>I have written a spring boot application. I have a two data sources - one is used by activiti engine for it's database and another datasource for updating my tables. The database updates to my tables are done in the event listeners. I have configured both the data sources as follows. The code is wor</description>
      <pubDate>Mon, 20 Jun 2016 19:11:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/multiple-data-sources-in-activiti/m-p/245521#M198651</guid>
      <dc:creator>davanna</dc:creator>
      <dc:date>2016-06-20T19:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Data sources in activiti</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/multiple-data-sources-in-activiti/m-p/245522#M198652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you have two datasource, you need XA transactions to be configured. A regular JPATransactionManager is not going to cut it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2016 08:12:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/multiple-data-sources-in-activiti/m-p/245522#M198652</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2016-06-22T08:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Data sources in activiti</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/multiple-data-sources-in-activiti/m-p/245523#M198653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the reply. I finally ended using the JTATransaction. But the above code works perfectly fine with my integration tests. Ideally with TransactionMaanger pointing to first datasource and working on second datasource, the db operations on second datasoruce must fail. It is not happening here. Just want to validate my theory that mybatis using second datasource is using the default autocommit feature and the transaction enclosing this operation is a no-op. &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2016 17:13:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/multiple-data-sources-in-activiti/m-p/245523#M198653</guid>
      <dc:creator>davanna</dc:creator>
      <dc:date>2016-06-22T17:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Data sources in activiti</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/multiple-data-sources-in-activiti/m-p/245524#M198654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;With two datasources, a regular transactionmanager won't cut it. When you involve multiple databases, you generally need XA transactions.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jun 2016 08:39:49 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/multiple-data-sources-in-activiti/m-p/245524#M198654</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2016-06-27T08:39:49Z</dc:date>
    </item>
  </channel>
</rss>

