Camunda H2 embedded database

Hi, i’m using docker compose file to deploy up camunda bpm + custom db.
After deployed the application and after 30 minutes i got connection issue between camunda engine and Mysql or Postgres DB.

This is my compose file:
postgres:
image: postgres:9.6
networks:
- ‘default’
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
POSTGRES_USER: camunda
POSTGRES_PASSWORD: camunda

camunda:
image: camunda/camunda-bpm-platform:7.17.0
environment:
DB_DRIVER: org.postgresql.Driver
DB_URL: jdbc:postgresql://postgres:5432/process-engine
DB_USERNAME: camunda
DB_PASSWORD: camunda
WAIT_FOR: postgres:5432
restart: unless-stopped
depends_on:
- postgres
networks:
- ‘default’

This is a piece of my stack trace
14-Nov-2022 13:29:37.438 INFO [http-nio-8080-exec-8] org.jboss.resteasy.spi.ResteasyDeployment.processApplication RESTEASY002205: Adding provider class org.camunda.bpm.engine.rest.exception.RestExceptionHandler from Application class org.camunda.bpm.admin.impl.web.AdminApplication
14-Nov-2022 14:04:54.808 SEVERE [http-nio-8080-exec-3] org.camunda.commons.logging.BaseLogger.logError ENGINE-16004 Exception while closing command context: An exception occurred in the persistence layer. Please check the server logs for a detailed message and the entire exception stack trace.
org.camunda.bpm.engine.ProcessEngineException: An exception occurred in the persistence layer. Please check the server logs for a detailed message and the entire exception stack trace.
at org.camunda.bpm.engine.impl.util.ExceptionUtil.wrapPersistenceException(ExceptionUtil.java:263)
at org.camunda.bpm.engine.impl.util.ExceptionUtil.doWithExceptionWrapper(ExceptionUtil.java:257)
at org.camunda.bpm.engine.impl.db.sql.DbSqlSession.executeSelectList(DbSqlSession.java:111)
at org.camunda.bpm.engine.impl.db.sql.DbSqlSession.selectList(DbSqlSession.java:103)

Caused by: org.apache.ibatis.exceptions.PersistenceException:

Error querying database. Cause: org.apache.ibatis.transaction.TransactionException: Error configuring AutoCommit. Your driver may not support getAutoCommit() or setAutoCommit(). Requested setting: false. Cause: com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

If the issue persist i think the only solution is using the h2 database but i just wanna know if is possible to persist the h2 in a volume or change the h2 database to file type and mount the file as a volume.

Thanks

Hi Mauro! Buongiorno!
Benvenuto al forum di Camunda.

Are there any reasons why you are using Postgres 9.6?
Can you try with newer versions?
It reached end of support in Camunda 7.17

Enrico

Hi Enrico,

no one specific reason, just a different DB from H2. But i got the same issue with mySql.
This is my compose file
mysql-camunda:
image: mysql:5.7
command: [ “–max_connections=400”, “–max_allowed_packet=32505856”]
volumes:
- camunda_volume_data:/var/lib/mysql
networks:
- ‘default’
environment:
MYSQL_ROOT_PASSWORD: camunda
MYSQL_USER: camunda
MYSQL_PASSWORD: camunda
MYSQL_DATABASE: process_engine
restart: unless-stopped

camunda:
image: camunda/camunda-bpm-platform:7.17.0
environment:
DB_DRIVER: com.mysql.cj.jdbc.Driver
DB_USERNAME: camunda
DB_PASSWORD: camunda
DB_URL: jdbc:mysql://mysql-camunda:3306/process_engine?autoReconnect=true
WAIT_FOR: mysql-camunda:3306
restart: unless-stopped
depends_on:
- mysql-camunda
networks:
- ‘default’
deploy:
replicas: 1

Anyway currently for persist the H2 DB i created a volume that map the h2-db folder.
volumes:
- camunda_data_db:/camunda/camunda-h2-dbs

Hi Mauro,
sorry for the late reply.
Your database may need some additional configuration.
Have a look at this (old) post:

Let me know how it goes.
Buona giornata,
Enrico

Hi Enrico, thanks for reply. I tried to set the autoCommit but the issue persist. You think i can keep the h2 mounted as a volume ?