<?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: Timeout behaviour in activity processing in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/timeout-behaviour-in-activity-processing/m-p/47457#M26923</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The "maxJobsPerAcquisition" property does not influence the retry-count. In order to prevent retries, extend the org.activiti.engine.impl.jobexecutor.DefaultFailedJobCommandFactory class. Override the getCommand() and return a command that ALWAYS sets the retries to 0 (base your impl on DecrementJobRetriesCmd):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt; public Object execute(CommandContext commandContext) {&lt;BR /&gt; JobEntity job = Context&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .getCommandContext()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .getJobEntityManager()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .findJobById(jobId);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; job.setRetries(0);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; job.setLockOwner(null);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; job.setLockExpirationTime(null);&lt;BR /&gt;&lt;BR /&gt; if(exception != null) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; job.setExceptionMessage(exception.getMessage());&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; job.setExceptionStacktrace(getExceptionStacktrace());&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt; }&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;Use a process-engine configuration with a JobExecutor set manually, and call the setLockTimeInMillis() with the value you need. Also, make sure that the transaction-timeout of your connection is AT LEAST as big as the lock-time you chose, otherwise the job will fail due to transaction-timeout.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This, in combination with the zero-retries-approach will fix your issue.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Dec 2013 12:39:20 GMT</pubDate>
    <dc:creator>frederikherema1</dc:creator>
    <dc:date>2013-12-10T12:39:20Z</dc:date>
    <item>
      <title>Timeout behaviour in activity processing</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/timeout-behaviour-in-activity-processing/m-p/47454#M26920</link>
      <description>Hi,in the following excerpt of our process definitionwaitState (TimerBoundaryEvent = 1second) -&amp;gt; Service Task 1 -&amp;gt; Service Task 2 (&amp;gt; 10 minutes)-&amp;gt;waitStateI have been observing that our chain of service tasks are being rexecuted for three times with an intervall of about 10 minutes.I kno</description>
      <pubDate>Thu, 10 Nov 2011 10:42:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/timeout-behaviour-in-activity-processing/m-p/47454#M26920</guid>
      <dc:creator>dokmatik</dc:creator>
      <dc:date>2011-11-10T10:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: Timeout behaviour in activity processing</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/timeout-behaviour-in-activity-processing/m-p/47455#M26921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The JobExecutor is responsible for executing the Timer associated with the first wait state.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In the default configuration Jobs are locked in the database for 5 minutes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If executing the job (in this case performing the transaction up to the second wait state) takes longer than 5 minutes, it will be executed again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Look at org.activiti.engine.impl.jobexecutor.JobExecutor, property lockTimeInMs&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It could also be that the job fails, then it is also retired. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would also worry about transaction timeouts.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2011 14:50:15 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/timeout-behaviour-in-activity-processing/m-p/47455#M26921</guid>
      <dc:creator>meyerd</dc:creator>
      <dc:date>2011-11-10T14:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: Timeout behaviour in activity processing</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/timeout-behaviour-in-activity-processing/m-p/47456#M26922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We would like to extend 5 min timeout as well number of retries.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;We have changed in activiti-engine.jar following fields of JobExecutor:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; protected int maxJobsPerAcquisition = 0; // no retries&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; protected int lockTimeInMillis = 20 * 60 * 1000; // 20 min&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;but behaviour of activiti seems stayed as before (after 5 min retry is triggered anyway), besides we have seen that act_ru_job table contains job with lock_exp_time_ set to 20 mins as it is in code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you know why is this happening?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;How to increase 5 mins and set retries to 0?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;BR&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Marije&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2013 09:23:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/timeout-behaviour-in-activity-processing/m-p/47456#M26922</guid>
      <dc:creator>mljolje</dc:creator>
      <dc:date>2013-12-09T09:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: Timeout behaviour in activity processing</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/timeout-behaviour-in-activity-processing/m-p/47457#M26923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The "maxJobsPerAcquisition" property does not influence the retry-count. In order to prevent retries, extend the org.activiti.engine.impl.jobexecutor.DefaultFailedJobCommandFactory class. Override the getCommand() and return a command that ALWAYS sets the retries to 0 (base your impl on DecrementJobRetriesCmd):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt; public Object execute(CommandContext commandContext) {&lt;BR /&gt; JobEntity job = Context&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .getCommandContext()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .getJobEntityManager()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .findJobById(jobId);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; job.setRetries(0);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; job.setLockOwner(null);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; job.setLockExpirationTime(null);&lt;BR /&gt;&lt;BR /&gt; if(exception != null) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; job.setExceptionMessage(exception.getMessage());&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; job.setExceptionStacktrace(getExceptionStacktrace());&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt; }&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;Use a process-engine configuration with a JobExecutor set manually, and call the setLockTimeInMillis() with the value you need. Also, make sure that the transaction-timeout of your connection is AT LEAST as big as the lock-time you chose, otherwise the job will fail due to transaction-timeout.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This, in combination with the zero-retries-approach will fix your issue.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Dec 2013 12:39:20 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/timeout-behaviour-in-activity-processing/m-p/47457#M26923</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2013-12-10T12:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: Timeout behaviour in activity processing</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/timeout-behaviour-in-activity-processing/m-p/47458#M26924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you for reply.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We are using postgres database so how we can set/change connection transaction-timeout in order to avoid those timeouts?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;BR&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Marije&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Dec 2013 13:21:54 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/timeout-behaviour-in-activity-processing/m-p/47458#M26924</guid>
      <dc:creator>mljolje</dc:creator>
      <dc:date>2013-12-11T13:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: Timeout behaviour in activity processing</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/timeout-behaviour-in-activity-processing/m-p/47459#M26925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;A simple google query gave me this: &lt;/SPAN&gt;&lt;A href="http://www.postgresql.org/docs/8.3/static/runtime-config-client.html" rel="nofollow noopener noreferrer"&gt;http://www.postgresql.org/docs/8.3/static/runtime-config-client.html&lt;/A&gt;&lt;SPAN&gt;. Search for timeout there.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Dec 2013 14:30:32 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/timeout-behaviour-in-activity-processing/m-p/47459#M26925</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2013-12-11T14:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: Timeout behaviour in activity processing</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/timeout-behaviour-in-activity-processing/m-p/47460#M26926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have expected to set that transaction timeout inside activiti over some property.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is that possible?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;BR&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Marije&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Dec 2013 15:11:33 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/timeout-behaviour-in-activity-processing/m-p/47460#M26926</guid>
      <dc:creator>mljolje</dc:creator>
      <dc:date>2013-12-11T15:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: Timeout behaviour in activity processing</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/timeout-behaviour-in-activity-processing/m-p/47461#M26927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Transaction timeout depends on the Database you're on and the datasource you're using. This is nothing Aciviti can set, since it differs for all implementations. Consult the docs of the DB/Driver/datasource you're using to set the connection-timeout value. Please note that having long transaction-timeouts generally has a negative impact on overall DB performance/memory usage.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For long-lasting operations (that don't explicitly need a transaction to be open), consider using a mechanism that halts the process (e.g.. with a receive-task) and do the work externally. When finished, just signal the process using the API (possibly passing any variables that need to be set as a result of the long-running operation).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you have a lot of long-running stuff, consider using camel and activiti for this, as camel has a lot of great stuff OOTB for this kind of use cases.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2013 07:53:49 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/timeout-behaviour-in-activity-processing/m-p/47461#M26927</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2013-12-12T07:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: Timeout behaviour in activity processing</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/timeout-behaviour-in-activity-processing/m-p/47462#M26928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is it possible to configure LockTimeInMillis on serviceTask level, but not globally for the JobExecutor? We have some async service tasks that are rather long-running and during their execution they need to read/write variables to DelegateExecution. So what is the recommended approach for this use case?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2016 14:53:45 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/timeout-behaviour-in-activity-processing/m-p/47462#M26928</guid>
      <dc:creator>nvulchev1</dc:creator>
      <dc:date>2016-02-17T14:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: Timeout behaviour in activity processing</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/timeout-behaviour-in-activity-processing/m-p/47463#M26929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"local" setting of LockTimeInMillis is not supported. (You could implement your own JobExecutor implementation). &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I would create real asynch call in your case. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. call service start (just take the request to start the execution and return immediately)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. wait on the message/signal from the service in the process execution to proceed further.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Martin &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2016 20:38:34 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/timeout-behaviour-in-activity-processing/m-p/47463#M26929</guid>
      <dc:creator>martin_grofcik</dc:creator>
      <dc:date>2016-02-17T20:38:34Z</dc:date>
    </item>
  </channel>
</rss>

