JDBC Connection Troubles

Hi,

I’m getting some errors while executing a batch with Camunda extension, sometimes I getting the following error:

15:39:20.210 [pool-1-thread-2] DEBUG org.springframework.jdbc.datasource.DataSourceTransactionManager - Participating in existing transaction
15:39:20.210 [pool-1-thread-2] DEBUG org.apache.ibatis.transaction.managed.ManagedTransaction - Closing JDBC Connection [Transaction-aware proxy for target Connection [HikariProxyConnection@1999990684 wrapping com.zaxxer.hikari.pool.ProxyConnection.ClosedConnection]]
15:39:20.210 [pool-1-thread-2] DEBUG org.springframework.transaction.support.TransactionTemplate - Initiating transaction rollback on application exception
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:107)
at org.camunda.bpm.engine.impl.db.sql.DbSqlSession.selectList(DbSqlSession.java:99)
at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.selectListWithRawParameter(DbEntityManager.java:182)
at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.selectList(DbEntityManager.java:174)
at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.selectList(DbEntityManager.java:170)
at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.selectList(DbEntityManager.java:154)
at org.camunda.bpm.engine.impl.persistence.entity.JobManager.findJobsByJobDefinitionId(JobManager.java:237)
at org.camunda.bpm.engine.impl.batch.BatchEntity.deleteSeedJob(BatchEntity.java:301)
at org.camunda.bpm.engine.impl.batch.BatchEntity.delete(BatchEntity.java:346)
at org.camunda.bpm.engine.impl.batch.BatchMonitorJobHandler.execute(BatchMonitorJobHandler.java:52)
at org.camunda.bpm.engine.impl.batch.BatchMonitorJobHandler.execute(BatchMonitorJobHandler.java:32)
at org.camunda.bpm.engine.impl.persistence.entity.JobEntity.execute(JobEntity.java:133)
at org.camunda.bpm.engine.impl.cmd.ExecuteJobsCmd.execute(ExecuteJobsCmd.java:110)
at org.camunda.bpm.engine.impl.cmd.ExecuteJobsCmd.execute(ExecuteJobsCmd.java:43)
at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:28)
at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:110)
at org.camunda.bpm.engine.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:46)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
at org.camunda.bpm.engine.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:44)
at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:70)
at org.camunda.bpm.engine.impl.interceptor.CommandCounterInterceptor.execute(CommandCounterInterceptor.java:35)
at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobHelper.executeJob(ExecuteJobHelper.java:57)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobsRunnable.executeJob(ExecuteJobsRunnable.java:110)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobsRunnable.run(ExecuteJobsRunnable.java:71)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: org.postgresql.util.PSQLException: An I/O error occurred while sending to the backend.
### The error may exist in org/camunda/bpm/engine/impl/mapping/entity/Job.xml
### The error may involve org.camunda.bpm.engine.impl.persistence.entity.JobEntity.selectJobsByJobDefinitionId-Inline
### The error occurred while setting parameters
### SQL: select *     from ACT_RU_JOB J     where J.JOB_DEF_ID_ = ?
### Cause: org.postgresql.util.PSQLException: An I/O error occurred while sending to the backend.
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:149)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140)
at org.camunda.bpm.engine.impl.db.sql.DbSqlSession.lambda$executeSelectList$1(DbSqlSession.java:107)
at org.camunda.bpm.engine.impl.util.ExceptionUtil.doWithExceptionWrapper(ExceptionUtil.java:254)
... 28 common frames omitted
Caused by: org.postgresql.util.PSQLException: An I/O error occurred while sending to the backend.
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:327)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:428)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:354)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:169)
at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:158)
at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59)
at com.sun.proxy.$Proxy30.execute(Unknown Source)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79)
at org.apache.ibatis.executor.BatchExecutor.doQuery(BatchExecutor.java:92)
at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324)
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)
... 31 common frames omitted
Caused by: java.net.SocketException: Socket closed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:171)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:140)
at org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:109)
at org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:67)
at org.postgresql.core.PGStream.receiveChar(PGStream.java:288)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1963)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:300)
... 50 common frames omitted
15:39:20.211 [pool-1-thread-2] DEBUG org.springframework.jdbc.datasource.DataSourceTransactionManager - Initiating transaction rollback
15:39:20.211 [pool-1-thread-2] DEBUG org.springframework.jdbc.datasource.DataSourceTransactionManager - Rolling back JDBC transaction on Connection [HikariProxyConnection@1999990684 wrapping com.zaxxer.hikari.pool.ProxyConnection.ClosedConnection]
15:39:20.211 [pool-1-thread-2] DEBUG org.springframework.jdbc.datasource.DataSourceTransactionManager - Could not reset JDBC Connection after transaction
java.sql.SQLException: Connection is closed
at com.zaxxer.hikari.pool.ProxyConnection$ClosedConnection.lambda$getClosedConnection$0(ProxyConnection.java:489)
at com.sun.proxy.$Proxy29.setAutoCommit(Unknown Source)
at com.zaxxer.hikari.pool.ProxyConnection.setAutoCommit(ProxyConnection.java:388)
at com.zaxxer.hikari.pool.HikariProxyConnection.setAutoCommit(HikariProxyConnection.java)
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doCleanupAfterCompletion(DataSourceTransactionManager.java:374)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.cleanupAfterCompletion(AbstractPlatformTransactionManager.java:1004)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:875)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:809)
at org.springframework.transaction.support.TransactionTemplate.rollbackOnException(TransactionTemplate.java:168)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:144)
at org.camunda.bpm.engine.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:44)
at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:70)
at org.camunda.bpm.engine.impl.interceptor.CommandCounterInterceptor.execute(CommandCounterInterceptor.java:35)
at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobHelper.executeJob(ExecuteJobHelper.java:57)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobsRunnable.executeJob(ExecuteJobsRunnable.java:110)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobsRunnable.run(ExecuteJobsRunnable.java:71)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
15:39:20.211 [pool-1-thread-2] DEBUG org.springframework.jdbc.datasource.DataSourceTransactionManager - Releasing JDBC Connection [HikariProxyConnection@1999990684 wrapping com.zaxxer.hikari.pool.ProxyConnection.ClosedConnection] after transaction
15:39:20.211 [pool-1-thread-2] ERROR org.springframework.transaction.support.TransactionTemplate - Application exception overridden by rollback exception
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:107)
at org.camunda.bpm.engine.impl.db.sql.DbSqlSession.selectList(DbSqlSession.java:99)
at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.selectListWithRawParameter(DbEntityManager.java:182)
at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.selectList(DbEntityManager.java:174)
at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.selectList(DbEntityManager.java:170)
at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.selectList(DbEntityManager.java:154)
at org.camunda.bpm.engine.impl.persistence.entity.JobManager.findJobsByJobDefinitionId(JobManager.java:237)
at org.camunda.bpm.engine.impl.batch.BatchEntity.deleteSeedJob(BatchEntity.java:301)
at org.camunda.bpm.engine.impl.batch.BatchEntity.delete(BatchEntity.java:346)
at org.camunda.bpm.engine.impl.batch.BatchMonitorJobHandler.execute(BatchMonitorJobHandler.java:52)
at org.camunda.bpm.engine.impl.batch.BatchMonitorJobHandler.execute(BatchMonitorJobHandler.java:32)
at org.camunda.bpm.engine.impl.persistence.entity.JobEntity.execute(JobEntity.java:133)
at org.camunda.bpm.engine.impl.cmd.ExecuteJobsCmd.execute(ExecuteJobsCmd.java:110)
at org.camunda.bpm.engine.impl.cmd.ExecuteJobsCmd.execute(ExecuteJobsCmd.java:43)
at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:28)
at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:110)
at org.camunda.bpm.engine.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:46)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
at org.camunda.bpm.engine.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:44)
at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:70)
at org.camunda.bpm.engine.impl.interceptor.CommandCounterInterceptor.execute(CommandCounterInterceptor.java:35)
at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobHelper.executeJob(ExecuteJobHelper.java:57)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobsRunnable.executeJob(ExecuteJobsRunnable.java:110)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobsRunnable.run(ExecuteJobsRunnable.java:71)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: org.postgresql.util.PSQLException: An I/O error occurred while sending to the backend.
### The error may exist in org/camunda/bpm/engine/impl/mapping/entity/Job.xml
### The error may involve org.camunda.bpm.engine.impl.persistence.entity.JobEntity.selectJobsByJobDefinitionId-Inline
### The error occurred while setting parameters
### SQL: select *     from ACT_RU_JOB J     where J.JOB_DEF_ID_ = ?
### Cause: org.postgresql.util.PSQLException: An I/O error occurred while sending to the backend.
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:149)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140)
at org.camunda.bpm.engine.impl.db.sql.DbSqlSession.lambda$executeSelectList$1(DbSqlSession.java:107)
at org.camunda.bpm.engine.impl.util.ExceptionUtil.doWithExceptionWrapper(ExceptionUtil.java:254)
... 28 common frames omitted
Caused by: org.postgresql.util.PSQLException: An I/O error occurred while sending to the backend.
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:327)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:428)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:354)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:169)
at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:158)
at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59)
at com.sun.proxy.$Proxy30.execute(Unknown Source)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79)
at org.apache.ibatis.executor.BatchExecutor.doQuery(BatchExecutor.java:92)
at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324)
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)
... 31 common frames omitted
Caused by: java.net.SocketException: Socket closed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:171)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:140)
at org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:109)
at org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:67)
at org.postgresql.core.PGStream.receiveChar(PGStream.java:288)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1963)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:300)
... 50 common frames omitted
15:39:20.212 [pool-1-thread-2] DEBUG org.camunda.bpm.engine.cmd - ENGINE-13006 Finishing command -------------------- ExecuteJobsCmd ----------------------
15:39:20.217 [SpringContextShutdownHook] DEBUG com.zaxxer.hikari.pool.HikariPool - fatca-camunda-pool - After shutdown stats (total=0, active=0, idle=0, waiting=0)
15:39:20.218 [SpringContextShutdownHook] INFO com.zaxxer.hikari.HikariDataSource - fatca-camunda-pool - Shutdown completed.

Sometimes I getting the following error:

[JobExecutor[org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor]] DEBUG org.apache.ibatis.transaction.managed.ManagedTransaction - Closing JDBC Connection [Transaction-aware proxy for target Connection [HikariProxyConnection@1798294585 wrapping org.postgresql.jdbc.PgConnection@7da2613f]]
16:38:02.486 [JobExecutor[org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor]] DEBUG org.springframework.jdbc.datasource.DataSourceTransactionManager - Initiating transaction commit
16:38:02.486 [JobExecutor[org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor]] DEBUG org.springframework.jdbc.datasource.DataSourceTransactionManager - Committing JDBC transaction on Connection [HikariProxyConnection@1798294585 wrapping org.postgresql.jdbc.PgConnection@7da2613f]
16:38:02.486 [JobExecutor[org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor]] DEBUG org.springframework.jdbc.datasource.DataSourceTransactionManager - Releasing JDBC Connection [HikariProxyConnection@1798294585 wrapping org.postgresql.jdbc.PgConnection@7da2613f] after transaction
16:38:02.486 [JobExecutor[org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor]] DEBUG org.camunda.bpm.engine.cmd - ENGINE-13006 Finishing command -------------------- AcquireJobsCmd ----------------------
16:38:02.486 [JobExecutor[org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor]] DEBUG org.camunda.bpm.engine.jobexecutor - ENGINE-14022 Acquired 0 jobs for process engine 'default': []
16:38:02.486 [JobExecutor[org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor]] DEBUG org.camunda.bpm.engine.jobexecutor - ENGINE-14011 Job acquisition thread sleeping for 4999 millis
16:38:02.486 [pool-1-thread-1] DEBUG org.apache.ibatis.transaction.managed.ManagedTransaction - Closing JDBC Connection [Transaction-aware proxy for target Connection [HikariProxyConnection@1463099401 wrapping org.postgresql.jdbc.PgConnection@62a80f41]]
16:38:02.486 [pool-1-thread-1] DEBUG org.springframework.jdbc.datasource.DataSourceTransactionManager - Initiating transaction commit
16:38:02.486 [pool-1-thread-1] DEBUG org.springframework.jdbc.datasource.DataSourceTransactionManager - Committing JDBC transaction on Connection [HikariProxyConnection@1463099401 wrapping org.postgresql.jdbc.PgConnection@62a80f41]
16:38:02.487 [fatca-camunda-pool connection closer] DEBUG com.zaxxer.hikari.pool.PoolBase - fatca-camunda-pool - Closing connection org.postgresql.jdbc.PgConnection@4c51cf28: (connection evicted)
16:38:02.487 [pool-1-thread-1] DEBUG org.springframework.jdbc.datasource.DataSourceTransactionManager - Releasing JDBC Connection [HikariProxyConnection@1463099401 wrapping org.postgresql.jdbc.PgConnection@62a80f41] after transaction
16:38:02.487 [pool-1-thread-1] DEBUG org.camunda.bpm.engine.cmd - ENGINE-13006 Finishing command -------------------- ExecuteJobsCmd ----------------------
16:38:02.487 [pool-1-thread-1] DEBUG org.camunda.bpm.engine.cmd - ENGINE-13005 Starting command -------------------- SuccessfulJobListener ----------------------
16:38:02.487 [pool-1-thread-1] DEBUG org.springframework.jdbc.datasource.DataSourceTransactionManager - Creating new transaction with name [null]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
16:38:02.487 [pool-1-thread-1] DEBUG org.camunda.bpm.engine.cmd - ENGINE-13006 Finishing command -------------------- SuccessfulJobListener ----------------------
16:38:02.487 [fatca-camunda-pool connection closer] DEBUG com.zaxxer.hikari.pool.PoolBase - fatca-camunda-pool - Closing connection org.postgresql.jdbc.PgConnection@7da2613f: (connection evicted)
16:38:02.487 [fatca-camunda-pool connection closer] DEBUG com.zaxxer.hikari.pool.PoolBase - fatca-camunda-pool - Closing connection org.postgresql.jdbc.PgConnection@736580fb: (connection evicted)
16:38:02.491 [fatca-camunda-pool connection closer] DEBUG com.zaxxer.hikari.pool.PoolBase - fatca-camunda-pool - Closing connection org.postgresql.jdbc.PgConnection@767df439: (connection evicted)
16:38:02.493 [pool-1-thread-1] WARN org.camunda.bpm.engine.jobexecutor - ENGINE-14006 Exception while executing job 28665: 
org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: HikariDataSource HikariDataSource (fatca-camunda-pool) has been closed.
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:305)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.startTransaction(AbstractPlatformTransactionManager.java:400)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:137)
at org.camunda.bpm.engine.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:44)
at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:70)
at org.camunda.bpm.engine.impl.interceptor.CommandCounterInterceptor.execute(CommandCounterInterceptor.java:35)
at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobHelper.invokeJobListener(ExecuteJobHelper.java:101)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobHelper.executeJob(ExecuteJobHelper.java:75)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobsRunnable.executeJob(ExecuteJobsRunnable.java:110)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobsRunnable.run(ExecuteJobsRunnable.java:71)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.sql.SQLException: HikariDataSource HikariDataSource (fatca-camunda-pool) has been closed.
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:96)
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:261)
... 14 common frames omitted
16:38:02.493 [pool-1-thread-1] DEBUG org.camunda.bpm.engine.cmd - ENGINE-13005 Starting command -------------------- ExecuteJobsCmd ----------------------
16:38:02.493 [pool-1-thread-1] DEBUG org.springframework.jdbc.datasource.DataSourceTransactionManager - Creating new transaction with name [null]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
16:38:02.493 [pool-1-thread-1] DEBUG org.camunda.bpm.engine.cmd - ENGINE-13006 Finishing command -------------------- ExecuteJobsCmd ----------------------
16:38:02.493 [pool-1-thread-1] DEBUG org.camunda.bpm.engine.cmd - ENGINE-13005 Starting command -------------------- FailedJobListener ----------------------
16:38:02.494 [pool-1-thread-1] DEBUG org.springframework.jdbc.datasource.DataSourceTransactionManager - Creating new transaction with name [null]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
16:38:02.494 [pool-1-thread-1] DEBUG org.camunda.bpm.engine.cmd - ENGINE-13006 Finishing command -------------------- FailedJobListener ----------------------
16:38:02.494 [pool-1-thread-1] WARN org.camunda.bpm.engine.jobexecutor - ENGINE-14006 Exception while executing job 28667: 
org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: HikariDataSource HikariDataSource (fatca-camunda-pool) has been closed.
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:305)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.startTransaction(AbstractPlatformTransactionManager.java:400)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:137)
at org.camunda.bpm.engine.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:44)
at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:70)
at org.camunda.bpm.engine.impl.interceptor.CommandCounterInterceptor.execute(CommandCounterInterceptor.java:35)
at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobHelper.callFailedJobListenerWithRetries(ExecuteJobHelper.java:113)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobHelper.invokeJobListener(ExecuteJobHelper.java:94)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobHelper.executeJob(ExecuteJobHelper.java:75)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobsRunnable.executeJob(ExecuteJobsRunnable.java:110)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobsRunnable.run(ExecuteJobsRunnable.java:71)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.sql.SQLException: HikariDataSource HikariDataSource (fatca-camunda-pool) has been closed.
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:96)
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:261)
... 15 common frames omitted
16:38:02.494 [JobExecutor[org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor]] DEBUG org.camunda.bpm.engine.jobexecutor - ENGINE-14012 Job acquisition thread woke up
16:38:02.494 [JobExecutor[org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor]] DEBUG org.camunda.bpm.engine.cmd - ENGINE-13005 Starting command -------------------- AcquireJobsCmd ----------------------
16:38:02.494 [JobExecutor[org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor]] DEBUG org.springframework.jdbc.datasource.DataSourceTransactionManager - Creating new transaction with name [null]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
16:38:02.494 [JobExecutor[org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor]] DEBUG org.camunda.bpm.engine.cmd - ENGINE-13006 Finishing command -------------------- AcquireJobsCmd ----------------------
16:38:02.494 [JobExecutor[org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor]] ERROR org.camunda.bpm.engine.jobexecutor - ENGINE-14019 Exception during job acquisition Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: HikariDataSource HikariDataSource (fatca-camunda-pool) has been closed.
org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: HikariDataSource HikariDataSource (fatca-camunda-pool) has been closed.
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:305)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.startTransaction(AbstractPlatformTransactionManager.java:400)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:137)
at org.camunda.bpm.engine.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:44)
at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:70)
at org.camunda.bpm.engine.impl.interceptor.CommandCounterInterceptor.execute(CommandCounterInterceptor.java:35)
at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
at org.camunda.bpm.engine.impl.jobexecutor.SequentialJobAcquisitionRunnable.acquireJobs(SequentialJobAcquisitionRunnable.java:158)
at org.camunda.bpm.engine.impl.jobexecutor.SequentialJobAcquisitionRunnable.run(SequentialJobAcquisitionRunnable.java:76)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.sql.SQLException: HikariDataSource HikariDataSource (fatca-camunda-pool) has been closed.
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:96)
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:261)
... 10 common frames omitted
16:38:02.494 [JobExecutor[org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor]] DEBUG org.camunda.bpm.engine.jobexecutor - ENGINE-14011 Job acquisition thread sleeping for 100 millis
16:38:02.495 [SpringContextShutdownHook] DEBUG com.zaxxer.hikari.pool.HikariPool - fatca-camunda-pool - After shutdown stats (total=0, active=0, idle=0, waiting=0)
16:38:02.495 [SpringContextShutdownHook] INFO com.zaxxer.hikari.HikariDataSource - fatca-camunda-pool - Shutdown completed.​

and I have had cases that do not pass any of the above, I don’t know if some threads of the batch are executing after the connection to the database is closed or something wrong happens with my own process engine configuration. Does somebody had this kind of issue ?

Thanks in advance!

Juan.

Facing the same issue…

I have a question… the routine which executes the Camunda batch is wrapped by a method that has a @Transactional annotation ?

No. It does not.
Have used “deleteProcessInstancesAsync” API method only

Hi Prachi,

Can you share how you have your implementation and the stack trace of your error?

Cheers.