# Timeout on synchronous Service Task

**URL:** <https://forum.flowable.org/t/timeout-on-synchronous-service-task/6061>\
**Category:** Uncategorized\
**Created:** [May 20, 2020, 8:17am UTC](https://forum.flowable.org/t/timeout-on-synchronous-service-task/6061 "2020-05-20T08:17:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![oszust002](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/oszust002/32/843_2.png) [@oszust002](https://forum.flowable.org/u/oszust002)\
**Post date:** [May 20, 2020, 8:17am UTC](https://forum.flowable.org/t/timeout-on-synchronous-service-task/6061/1 "2020-05-20T08:17:51Z")

</div>

I have standard ServiceTask (not async), which makes http requests, but after 20 minutes, even if all requests are done, I’m getting error that current Transaction was already rolled back. Is there any way to set this timeout somehow in activiti?

---

<div class="post-metadata">

**Author:** ![martin.grofcik](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/martin.grofcik/32/71_2.png) [@martin.grofcik](https://forum.flowable.org/u/martin.grofcik)\
**Post date:** [May 21, 2020, 12:34pm UTC](https://forum.flowable.org/t/timeout-on-synchronous-service-task/6061/2 "2020-05-21T12:34:34Z")

</div>

Does it make sense to block thread for 20mins to only wait on response?  
Regards  
Martin

---

<div class="post-metadata">

**Author:** ![oszust002](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/oszust002/32/843_2.png) [@oszust002](https://forum.flowable.org/u/oszust002)\
**Post date:** [May 22, 2020, 5:21pm UTC](https://forum.flowable.org/t/timeout-on-synchronous-service-task/6061/3 "2020-05-22T17:21:26Z")

</div>

In this case yes, clients require business logic that works that way, they write fully automated processes that runs that long tasks (and does not care about async tasks and signals), so we need that kind of thing

---

<div class="post-metadata">

**Author:** ![martin.grofcik](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/martin.grofcik/32/71_2.png) [@martin.grofcik](https://forum.flowable.org/u/martin.grofcik)\
**Post date:** [May 25, 2020, 8:38am UTC](https://forum.flowable.org/t/timeout-on-synchronous-service-task/6061/4 "2020-05-25T08:38:43Z")

</div>

What is the cause of transaction rollback? (I would expect some kind of timeout -\> increase timeout).  
Martin

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [May 26, 2020, 8:25pm UTC](https://forum.flowable.org/t/timeout-on-synchronous-service-task/6061/5 "2020-05-26T20:25:33Z")

</div>

Transaction timeouts are typically set on the database level.  
But keeping a transaction open for so long is not ideal for resources, isn’t there a way to solve this differently without keeping open a transaction (e.g. sending a message to a queue, handling it there such that it calls the slow task and then calls back to the process?)
