<?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 Re: Persistence in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/persistence/m-p/29559#M15112</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ronald,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, thanks, thanks! I have tried the following (having obtained the datasource with the @Resource annotation before):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProcessEngineConfiguration pec = ProcessEngineConfiguration.createProcessEngineConfigurationFromResourceDefault();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pec.setDataSource(datasource);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pec.setTransactionsExternallyManaged(true);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; engine = pec.buildProcessEngine();&lt;BR /&gt;&lt;/CODE&gt;&lt;SPAN&gt;And it works like a charm!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Besides, I have tried the Singleton EJB for the engine, and it works too. I have made the tests with others DB updates (with a JPA EntityManager configured with a totally independent datasource), and have proved that both updates are committed or rolled back together (probably with two-phase commit protocol). So everything is working great.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Activiti doesnt yet (fully) work with JTA.&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt;What do you exactly mean?. All the tests that I have made worked fine. I would like to know what could fail and in what circumstances.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks very much.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Jan 2011 15:44:08 GMT</pubDate>
    <dc:creator>tizo</dc:creator>
    <dc:date>2011-01-25T15:44:08Z</dc:date>
    <item>
      <title>Persistence</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/persistence/m-p/29556#M15109</link>
      <description>We have had some problems with persistence in Activiti. First I will describe the environment where we are using it.Activiti is used in an EJB, which is deployed in a GlassFish server. Spring is not used. The engine is created when an instance of the EJB is created (in a method annotated with @PostC</description>
      <pubDate>Mon, 24 Jan 2011 18:56:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/persistence/m-p/29556#M15109</guid>
      <dc:creator>tizo</dc:creator>
      <dc:date>2011-01-24T18:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: Persistence</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/persistence/m-p/29557#M15110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I know that probably this is a bad decision for the performance, but after finding a solution for the problem of persistence, we will try to start the Activiti engine as a GlassFish service, and obtain it with jndi.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;We currently do it in an EJB3.1 singleton… works great.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;- Making Activiti use the same Entity Manager that is used by the EJB, as it is configured with JTA.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;This would mean rewriting the db core of Activiti… Nice, interesting excercise, but a decent amount of work. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;- Making Activiti use a DataSource obtained from the container (with @Resource annotation).&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt;Or have the option to pass in a datasource in another way. @Resource binds you to a container, which is currently not needed. Starting it in an EJB, where you have the datasource and use that when starting the engine would be an option I think.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But there is a third wat. Have Activiti use the same transaction as the container in which a call to Activiti is made. This is still experimental though, but feedback is appreciated…Look here: &lt;/SPAN&gt;&lt;A href="http://www.activiti.org/userguide/index.html#configurationRoot" rel="nofollow noopener noreferrer"&gt;http://www.activiti.org/userguide/index.html#configurationRoot&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jan 2011 19:22:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/persistence/m-p/29557#M15110</guid>
      <dc:creator>ronald_van_kuij</dc:creator>
      <dc:date>2011-01-24T19:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Persistence</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/persistence/m-p/29558#M15111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Activiti doesnt yet (fully) work with JTA. It is on the roadmap for next month I believe (have to check).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We only have a dependency on Spring for parsing our configuration. You can use that same configurtation to configure your datasource from jndi and inject it into the Activiti configuration.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jan 2011 09:00:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/persistence/m-p/29558#M15111</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2011-01-25T09:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: Persistence</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/persistence/m-p/29559#M15112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ronald,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, thanks, thanks! I have tried the following (having obtained the datasource with the @Resource annotation before):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProcessEngineConfiguration pec = ProcessEngineConfiguration.createProcessEngineConfigurationFromResourceDefault();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pec.setDataSource(datasource);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pec.setTransactionsExternallyManaged(true);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; engine = pec.buildProcessEngine();&lt;BR /&gt;&lt;/CODE&gt;&lt;SPAN&gt;And it works like a charm!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Besides, I have tried the Singleton EJB for the engine, and it works too. I have made the tests with others DB updates (with a JPA EntityManager configured with a totally independent datasource), and have proved that both updates are committed or rolled back together (probably with two-phase commit protocol). So everything is working great.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Activiti doesnt yet (fully) work with JTA.&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt;What do you exactly mean?. All the tests that I have made worked fine. I would like to know what could fail and in what circumstances.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks very much.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jan 2011 15:44:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/persistence/m-p/29559#M15112</guid>
      <dc:creator>tizo</dc:creator>
      <dc:date>2011-01-25T15:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: Persistence</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/persistence/m-p/29560#M15113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;What do you exactly mean?. All the tests that I have made worked fine. I would like to know what could fail and in what circumstances.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm sorry, I had to be more specific. Activiti does not yet support the case when Activiti is the driver of the transactions: ie Activiti starts/commits/rollbacks the JTA transaction itself. Your case is indeed covered, as you call Activiti from within a transactional context already.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jan 2011 09:12:55 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/persistence/m-p/29560#M15113</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2011-01-26T09:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: Persistence</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/persistence/m-p/29561#M15114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Would be good to add this to the docs… I'll make a jira for this&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jan 2011 12:30:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/persistence/m-p/29561#M15114</guid>
      <dc:creator>ronald_van_kuij</dc:creator>
      <dc:date>2011-01-26T12:30:11Z</dc:date>
    </item>
  </channel>
</rss>

