# Spring Boot integration with a differnet database

**URL:** <https://forum.flowable.org/t/spring-boot-integration-with-a-differnet-database/5993>\
**Category:** Flowable Engine\
**Created:** [May 11, 2020, 1:27pm UTC](https://forum.flowable.org/t/spring-boot-integration-with-a-differnet-database/5993 "2020-05-11T13:27:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![RedCoder9](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/redcoder9/32/1837_2.png) [@RedCoder9](https://forum.flowable.org/u/RedCoder9)\
**Post date:** [May 11, 2020, 1:27pm UTC](https://forum.flowable.org/t/spring-boot-integration-with-a-differnet-database/5993/1 "2020-05-11T13:27:48Z")

</div>

Hi  
I’m searching also how to separate flowable tables from my business database. I tried this bean  
@Bean  
EngineConfigurationConfigurer EngineConfigurationConfigurer(@Qualifier(“flowableDataSource”) DataSource dataSource) {  
return engineConfiguration -\> engineConfiguration.setDataSource(dataSource);  
}  
but what i noticed that it created the flowable tables and my business tables in the same database, so would you mind telling what I’m missing ?

---

<div class="post-metadata">

**Author:** ![fiki574](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/fiki574/32/1675_2.png) [@fiki574](https://forum.flowable.org/u/fiki574)\
**Post date:** [May 11, 2020, 2:29pm UTC](https://forum.flowable.org/t/spring-boot-integration-with-a-differnet-database/5993/2 "2020-05-11T14:29:13Z")

</div>

Hey, here’s the solution that worked for me.

application.properties additions:

```
business.datasource.driver-class-name=org.postgresql.Driver
business.datasource.jdbc-url=jdbc:postgresql://192.168.0.1:5432/business
business.datasource.username=business
business.datasource.password=business
flowable.datasource.driver-class-name=org.postgresql.Driver
flowable.datasource.jdbc-url=jdbc:postgresql://192.168.0.2:5432/flowable
flowable.datasource.username=flowable
flowable.datasource.password=flowable

```

Datasource and transaction manager setup:

```
@Bean(name = "businessDataSource")
@Primary
@ConfigurationProperties(prefix = "business.datasource")
public DataSource primaryDataSource() {
  return DataSourceBuilder.create().build();
}

@Bean(name = "flowableDataSource")
@ConfigurationProperties(prefix = "flowable.datasource")
public DataSource secondaryDataSource() {
 return DataSourceBuilder.create().build();
}

@Bean(name = "flowableTransactionManager")
public PlatformTransactionManager transactionManager() {
DataSourceTransactionManager transactionManager = new DataSourceTransactionManager();
transactionManager.setDataSource(secondaryDataSource());
  return transactionManager;
}

```

Flowable configuration

```
@Autowired
@Qualifier("flowableDataSource")
private DataSource dataSource;

@Autowired
@Qualifier("flowableTransactionManager")
private PlatformTransactionManager transactionManager;

@Bean
public EngineConfigurationConfigurer<SpringAppEngineConfiguration> engineConfigurer() {
  return configuration -> {
    configuration.setDataSource(dataSource);
    configuration.setTransactionManager(transactionManager);
    configuration.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_FALSE);
  };
}
```

---

<div class="post-metadata">

**Author:** ![RedCoder9](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/redcoder9/32/1837_2.png) [@RedCoder9](https://forum.flowable.org/u/RedCoder9)\
**Post date:** [May 11, 2020, 3:04pm UTC](https://forum.flowable.org/t/spring-boot-integration-with-a-differnet-database/5993/3 "2020-05-11T15:04:25Z")

</div>

I changed db schema update to true and it worked. Thank you so much for your help.

---

<div class="post-metadata">

**Author:** ![medaminebenahmed](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@medaminebenahmed](https://forum.flowable.org/u/medaminebenahmed)\
**Post date:** [May 11, 2020, 3:04pm UTC](https://forum.flowable.org/t/spring-boot-integration-with-a-differnet-database/5993/4 "2020-05-11T15:04:54Z")

</div>

Thanks , it work for me . 😀

---

<div class="post-metadata">

**Author:** ![fhubin](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/fhubin/32/3068_2.png) [@fhubin](https://forum.flowable.org/u/fhubin)\
**Post date:** [August 28, 2023, 1:25pm UTC](https://forum.flowable.org/t/spring-boot-integration-with-a-differnet-database/5993/5 "2023-08-28T13:25:46Z")

</div>

It worked for me too. Thanks.

---

<div class="post-metadata">

**Author:** ![Anderson](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@Anderson](https://forum.flowable.org/u/Anderson)\
**Post date:** [December 1, 2025, 6:14pm UTC](https://forum.flowable.org/t/spring-boot-integration-with-a-differnet-database/5993/6 "2025-12-01T18:14:39Z")

</div>

I did the same setup but its not working for me I am getting below error in my code, can someone help here @fiki574

Parameter 0 of method jpaProcessEngineConfigurer in org.flowable.spring.boot.FlowableJpaAutoConfiguration required a single bean, but 2 were found:

- App1EntityManagerFactory: defined by method ‘app1EntityManagerFactory’ in class path resource ..
- App2EntityManagerFactory: defined by method ‘app2EntityManagerFactory’ in class path resource…
