<?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: Activiti JavaDelegate, JPA and JTA best practice in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/activiti-javadelegate-jpa-and-jta-best-practice/m-p/57082#M34651</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The JPA-configurations you only need when you want to use JPA-entities as process-variables in your processes. If you're just using JPA alongside your process (calling your own services from the process for example), it's not needed.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Sep 2011 07:09:49 GMT</pubDate>
    <dc:creator>frederikherema1</dc:creator>
    <dc:date>2011-09-05T07:09:49Z</dc:date>
    <item>
      <title>Activiti JavaDelegate, JPA and JTA best practice</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-javadelegate-jpa-and-jta-best-practice/m-p/57078#M34647</link>
      <description>Hello,i want to create/query entities using JPA in an JavaDelegateand i have Activiti configured to use JTA and a datasource from Glassfish 3.1.1.Within a JavaDelegate serviceTask I lookup the EntityManagerusing JNDI and use this entity manager for my entity. Then iset the entity as process variable</description>
      <pubDate>Wed, 17 Aug 2011 22:30:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-javadelegate-jpa-and-jta-best-practice/m-p/57078#M34647</guid>
      <dc:creator>chris_joelly</dc:creator>
      <dc:date>2011-08-17T22:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti JavaDelegate, JPA and JTA best practice</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-javadelegate-jpa-and-jta-best-practice/m-p/57079#M34648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It should basically work, the way you describe it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any chance you could wrap it up in a simple unit test so I can test it myself?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Aug 2011 08:04:55 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-javadelegate-jpa-and-jta-best-practice/m-p/57079#M34648</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2011-08-26T08:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti JavaDelegate, JPA and JTA best practice</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-javadelegate-jpa-and-jta-best-practice/m-p/57080#M34649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;i am working on a unit test which deploys the ejb and war to a glassfish-embedded&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and i hope i can simulate this behavior. but at the moment i have issues getting&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;glassfish-embedded to work. only test the Activiti will not be the same scenario.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Sep 2011 08:34:20 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-javadelegate-jpa-and-jta-best-practice/m-p/57080#M34649</guid>
      <dc:creator>chris_joelly</dc:creator>
      <dc:date>2011-09-03T08:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti JavaDelegate, JPA and JTA best practice</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-javadelegate-jpa-and-jta-best-practice/m-p/57081#M34650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think i found my problem. If i put a UserTransaction around the Activiti calls &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;then i can avoid these exceptions, the UserTransaction utx is injeced via&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;@Resource into the @ManagedBean:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; utx.begin();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; List&amp;lt;Task&amp;gt; tasks = activiti.getProcessEngine().getTaskService()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .createTaskQuery()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .taskAssignee(userSession.getUser().getUsername())&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .orderByTaskCreateTime().asc().list();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; utx.commit();&lt;BR /&gt;&lt;/CODE&gt;&lt;SPAN&gt;So: i need to start and end a transaction if i call Activiti services in an Bean&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;outside of an EJB and i dont need to do it if i use Activiti services within an EJB&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if i use transactionsExternallyManaged = true. Btw. if i use transactionsExternallyManaged&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;set to false it works too.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But what i even dont understand is are the cfg options jpaPersistenceUnitName, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;jpaHandleTransaction and jpaCloseEntityManager. When do i need these parameters?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dont they interfer with a JTA setup?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Sep 2011 21:44:48 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-javadelegate-jpa-and-jta-best-practice/m-p/57081#M34650</guid>
      <dc:creator>chris_joelly</dc:creator>
      <dc:date>2011-09-04T21:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti JavaDelegate, JPA and JTA best practice</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-javadelegate-jpa-and-jta-best-practice/m-p/57082#M34651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The JPA-configurations you only need when you want to use JPA-entities as process-variables in your processes. If you're just using JPA alongside your process (calling your own services from the process for example), it's not needed.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Sep 2011 07:09:49 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-javadelegate-jpa-and-jta-best-practice/m-p/57082#M34651</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2011-09-05T07:09:49Z</dc:date>
    </item>
  </channel>
</rss>

