# Using existing database to read and write model

**URL:** <https://forum.flowable.org/t/using-existing-database-to-read-and-write-model/1626>\
**Category:** Flowable Engine\
**Created:** [February 10, 2018, 12:19pm UTC](https://forum.flowable.org/t/using-existing-database-to-read-and-write-model/1626 "2018-02-10T12:19:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![booshan](https://avatars.discourse-cdn.com/v4/letter/b/a87d85/32.png) [@booshan](https://forum.flowable.org/u/booshan)\
**Post date:** [February 10, 2018, 12:19pm UTC](https://forum.flowable.org/t/using-existing-database-to-read-and-write-model/1626/1 "2018-02-10T12:19:50Z")

</div>

Flow Gurus, we have existing application and we are exploring to use Flowable. Lot of data changes and actions happen from a webapp. How can I have Flowable write the status with other modified information in the existing database, and also read from it each time a new task needs to be performed? I understand we can create a service task to write externally outside of Flowable, but is there any built-in function within Flowable, so the data in Flowable context and the actual database is always in sync?

Regards  
Booshan

---

<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:** [February 12, 2018, 2:58pm UTC](https://forum.flowable.org/t/using-existing-database-to-read-and-write-model/1626/2 "2018-02-12T14:58:44Z")

</div>

The easiest way to do this, is to use for example the transaction manager from Spring. You inject the datasource/transaction manager into the process engine configuration. From that point on, all code marked as transactionally together (e.g. with the @Transactional annotation) will be executed within the same database transaction.

---

<div class="post-metadata">

**Author:** ![booshan](https://avatars.discourse-cdn.com/v4/letter/b/a87d85/32.png) [@booshan](https://forum.flowable.org/u/booshan)\
**Post date:** [February 17, 2018, 5:47pm UTC](https://forum.flowable.org/t/using-existing-database-to-read-and-write-model/1626/3 "2018-02-17T17:47:25Z")

</div>

Hi Joram, thanks for your reply. Is there any example in the flowable examples?

---

<div class="post-metadata">

**Author:** ![booshan](https://avatars.discourse-cdn.com/v4/letter/b/a87d85/32.png) [@booshan](https://forum.flowable.org/u/booshan)\
**Post date:** [February 18, 2018, 11:48am UTC](https://forum.flowable.org/t/using-existing-database-to-read-and-write-model/1626/4 "2018-02-18T11:48:02Z")

</div>

Hi Joram, never mind. I got this working. Thanks for your direction.
