<?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: Failed to compensate (Transaction marked Rollback only ) in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/failed-to-compensate-transaction-marked-rollback-only/m-p/139086#M97475</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Fred, to me it seems like a very valid use-case where a ServiceTask might call an existing @Transactional ServiceAPI(which could throw Service level Exceptions), and enterprise applications which are utilizing Container level transaction manager will run into the above mentioned issue. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Having said that, i wanted to check if i am doing something wrong by relying on both transaction+compensation to rollback the changes done by the workflow?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you recommend any alternative approach for the above scenario?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Jul 2013 06:38:03 GMT</pubDate>
    <dc:creator>vivverma</dc:creator>
    <dc:date>2013-07-11T06:38:03Z</dc:date>
    <item>
      <title>Failed to compensate (Transaction marked Rollback only )</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/failed-to-compensate-transaction-marked-rollback-only/m-p/139082#M97471</link>
      <description>Hi All,The Problem is described below:-1) My Application X has activiti engine embedded inside it to execute certain Workflows.2) X utilizes global JTATransactionManager and an XA Datasource, and passes the same to Activiti while configuring SpringProcessEngineConfiguration.3) The Workflow has two t</description>
      <pubDate>Mon, 08 Jul 2013 07:03:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/failed-to-compensate-transaction-marked-rollback-only/m-p/139082#M97471</guid>
      <dc:creator>vivverma</dc:creator>
      <dc:date>2013-07-08T07:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: Failed to compensate (Transaction marked Rollback only )</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/failed-to-compensate-transaction-marked-rollback-only/m-p/139083#M97472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;can you clarify this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;T2 call fails and marks the Trasaction Status to rollback, however the execption is caught in the Service Task so that a Compensation could be triggered.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Is the T2 a custom service-task or a webservice-task? If it's a service-task, make sure that the exception doesn't reach the activiti execution-stack (try-catch ignore in the execute() method itself). How are you throwing the compensation-event?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jul 2013 08:34:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/failed-to-compensate-transaction-marked-rollback-only/m-p/139083#M97472</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2013-07-09T08:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: Failed to compensate (Transaction marked Rollback only )</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/failed-to-compensate-transaction-marked-rollback-only/m-p/139084#M97473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;T2 is a ServiceTask that invokes one of the Application's Service API(say updateCore). The invoked API(updateCore) is a transactional API and throws application specific Exceptions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;All code within the Service task is wrapped inside a try catch block so that exceptions could be caught and a compensation could be fired.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Whenever there is an exception thrown from the service api(updateCore), the exception crosses the logical transaction boundary(which in this case is the Service Class) and hence Spring marks the transaction to ROLLBACK only.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Now since Activiti and the Application are sharing the same Transaction Manager and participating in same the Transaction, whenever Activiti tries to query anything from the DB, it encounter this Rollback Exception.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jul 2013 10:48:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/failed-to-compensate-transaction-marked-rollback-only/m-p/139084#M97473</guid>
      <dc:creator>vivverma</dc:creator>
      <dc:date>2013-07-09T10:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: Failed to compensate (Transaction marked Rollback only )</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/failed-to-compensate-transaction-marked-rollback-only/m-p/139085#M97474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I see what you mean. I'm afraid there is no way around this. Activiti needs to hook into the an active transaction to retain the state/trace of the process up until that point, before executing the actual "compensation" behavior.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jul 2013 07:06:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/failed-to-compensate-transaction-marked-rollback-only/m-p/139085#M97474</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2013-07-10T07:06:02Z</dc:date>
    </item>
    <item>
      <title>Re: Failed to compensate (Transaction marked Rollback only )</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/failed-to-compensate-transaction-marked-rollback-only/m-p/139086#M97475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Fred, to me it seems like a very valid use-case where a ServiceTask might call an existing @Transactional ServiceAPI(which could throw Service level Exceptions), and enterprise applications which are utilizing Container level transaction manager will run into the above mentioned issue. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Having said that, i wanted to check if i am doing something wrong by relying on both transaction+compensation to rollback the changes done by the workflow?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you recommend any alternative approach for the above scenario?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jul 2013 06:38:03 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/failed-to-compensate-transaction-marked-rollback-only/m-p/139086#M97475</guid>
      <dc:creator>vivverma</dc:creator>
      <dc:date>2013-07-11T06:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: Failed to compensate (Transaction marked Rollback only )</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/failed-to-compensate-transaction-marked-rollback-only/m-p/139087#M97476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Alternative approach that I can think of is using an additional TransactionSynchronisationAdapter (if you're using Spring, that is). After all changes have been rolled back (transaction-rollback) to both activiti and your service, you can use the adapter to force a new transaction (REQUIRES_NEW) and try running the compensation-behaviour manually. Offcourse, this won't be using the "compensation" that is built in into BPMN, as the process has been rolled back and the process-state is not suited for a compensation since it doesn't know anything went wrong (take a look at the org.activiti.engine.impl.jobexecutor.FailedJobListener which we use to decrement job retries after rollback in job-execution).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the current implement ion, you should either rely on the transaction being rolled back completely (so process-state remains as it was before the API-call was made) or either use compensation for scenario's where the transaction has not been rolled back by the failure…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I understand that this is a valid use-case for compensation working with @Transactional rollback, although really hard to implement as I mentioned before due to the fact that the process-changes are done in the rolled-back transaction. So I don't see such behavior being added any time soon to the engine, I'm afraid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jul 2013 07:17:46 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/failed-to-compensate-transaction-marked-rollback-only/m-p/139087#M97476</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2013-07-12T07:17:46Z</dc:date>
    </item>
  </channel>
</rss>

