# Running two java services pointing to single flowable database

**URL:** https://forum.flowable.org/t/running-two-java-services-pointing-to-single-flowable-database/7174
**Category:** Flowable Engine
**Created:** [December 4, 2020, 8:33am UTC](https://forum.flowable.org/t/running-two-java-services-pointing-to-single-flowable-database/7174 "2020-12-04T08:33:37Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![vchavan79](https://avatars.discourse-cdn.com/v4/letter/v/76d3ee/32.png) [@vchavan79](https://forum.flowable.org/u/vchavan79)
#### Post date: [December 4, 2020, 8:33am UTC](https://forum.flowable.org/t/running-two-java-services-pointing-to-single-flowable-database/7174/1 "2020-12-04T08:33:37Z")

</div>

Hi,

We are using flowable 6.4.0 as our BPMN engine. Our application consumes JMS event and triggers flowable process that has multiple service tasks, wait timer and exclusive gateways to decide and follow correct business process path. Currently our java service is running in test and it running with single instance. Soon we want to deploy it to production and there is possibility to run our java service with multiple instances ( on separate nodes/servers to support main and failover), so will there be any issues if we run our java service with multiple instance and shared flowable database?  
So question / concern I have is,

1. We have timer wait activity that waits for a day and then resume pending tasks, in case of two instances of same java services, will both java services pick the waiting task and execute it?.  
If yes, should we run with only single instance or is there a way to restrict task execution on only one java service instance?  
So basically I am not sure how flowable behaves in case of two or more instances of a same service, in a microservices (same service with multiple instances) kind of setup?

Thanks,  
Vijay Chavan

---

<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: [December 4, 2020, 11:25pm UTC](https://forum.flowable.org/t/running-two-java-services-pointing-to-single-flowable-database/7174/2 "2020-12-04T23:25:56Z")

</div>

> [@vchavan79](#):
>
> We are using flowable 6.4.0 as our BPMN engine.

Is there a reason for not using the latest version (6.6.0)? 6.4.0 is quite old and many bugs have been fixed and improvements have been added since.

> [@vchavan79](#):
>
> so will there be any issues if we run our java service with multiple instance and shared flowable database?

No, Flowable has been designed for exactly this scenario.

> [@vchavan79](#):
>
> We have timer wait activity that waits for a day and then resume pending tasks, in case of two instances of same java services, will both java services pick the waiting task and execute it?.

No, timer events are picked up, locked and executed by a single node.

---

<div class="post-metadata">

### Author: ![vchavan79](https://avatars.discourse-cdn.com/v4/letter/v/76d3ee/32.png) [@vchavan79](https://forum.flowable.org/u/vchavan79)
#### Post date: [December 7, 2020, 11:40am UTC](https://forum.flowable.org/t/running-two-java-services-pointing-to-single-flowable-database/7174/3 "2020-12-07T11:40:15Z")

</div>

@joram thanks for you inputs. There is no any reason for using 6.4.0, but this is existing service and we just need to priorities and do the migration to 6.6.0.
