<?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 Unexpected behaviour of Activiti Engine with using Spring JTA transaction in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/unexpected-behaviour-of-activiti-engine-with-using-spring-jta/m-p/181161#M134291</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Overview:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have Service Task (Java Delegate), which calls my custom Spring Service, which has Spring Annotated Transaction with Propogation.REQUIRED. (See EmpDetailService.java)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Scenario 1: After completing "Emp Details 1" task control goes to "Emp Details 1 Service(Java Delegates)" service task which calls&amp;nbsp; custom DB service to persist data into custom tables.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;now while I throw exception explicitly in service task than "Emp Details 1" task don't complete (not data insert, update, and delete in Activiti tables) and no data gets persisted in my custom tables which is expected behaviour.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Scenario 2: After completing "Emp Details 1" task control goes to "Emp Details 1 Service(Java Delegates)" service task which calls&amp;nbsp; custom DB service to persist data into custom tables. In this scenario I am explicitly setting null (NOT NULL in DATABASE )&amp;nbsp; value in custom table, So while inserting/updating a record Hibernate throws exception (org.hibernate.exception.ConstraintViolationException: Column 'FIRST_NAME' cannot be null) , but surprisingly this time "Emp Details 1" task gets completed and no data gets persisted in custom tables.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, in nutshell difference between both the scenarios is that in Scenario 1 I am throwing exception explicitly and in Scenario 2 I get exception from underlying Persistence layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Question:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am unable to understand that why in Scenario 2 task gets completed even though exception is being thrown by hibernate in "Emp Details 1 Service"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have also attached error_log.txt and my activiti configuration file and spring service class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Jul 2015 13:17:39 GMT</pubDate>
    <dc:creator>savanladani</dc:creator>
    <dc:date>2015-07-03T13:17:39Z</dc:date>
    <item>
      <title>Unexpected behaviour of Activiti Engine with using Spring JTA transaction</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/unexpected-behaviour-of-activiti-engine-with-using-spring-jta/m-p/181161#M134291</link>
      <description>Overview:I have Service Task (Java Delegate), which calls my custom Spring Service, which has Spring Annotated Transaction with Propogation.REQUIRED. (See EmpDetailService.java)Scenario 1: After completing "Emp Details 1" task control goes to "Emp Details 1 Service(Java Delegates)" service task whic</description>
      <pubDate>Fri, 03 Jul 2015 13:17:39 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/unexpected-behaviour-of-activiti-engine-with-using-spring-jta/m-p/181161#M134291</guid>
      <dc:creator>savanladani</dc:creator>
      <dc:date>2015-07-03T13:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: Unexpected behaviour of Activiti Engine with using Spring JTA transaction</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/unexpected-behaviour-of-activiti-engine-with-using-spring-jta/m-p/181162#M134292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;But in the example Java file you've attached you catch the exception, so the data insert might have failed, but the Activiti Engine will continue with completing the task. If this is not the desired behaviour I think you should not catch the exception in the service task or rethrow it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Jul 2015 19:07:46 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/unexpected-behaviour-of-activiti-engine-with-using-spring-jta/m-p/181162#M134292</guid>
      <dc:creator>trademak</dc:creator>
      <dc:date>2015-07-05T19:07:46Z</dc:date>
    </item>
  </channel>
</rss>

