Camunda 7 - Spring Boot - Shutdown race condition

When our application shuts down sometimes we get an ENGINE-07018 error. After some investigating I discovered a race condition that when the error happens the Engine & database connection thread pool shutdown before the SpringProcessApplication. Is this something known with possible fixes that I can implement or ways for me to control Camunda’s shutdown. Or could it be a bug in Camunda

Logs & stack trace of the shutdown

2024-10-30 15:43:40.543  INFO 50336 --- [                SpringApplicationShutdownHook] org.camunda.bpm.engine                  : ENGINE-00007 Process Engine default closed
2024-10-30 15:43:40.543  INFO 50336 --- [                SpringApplicationShutdownHook] com.zaxxer.hikari.HikariDataSource      : HikariPool-1 - Shutdown initiated...
2024-10-30 15:43:40.549  INFO 50336 --- [                SpringApplicationShutdownHook] com.zaxxer.hikari.HikariDataSource      : HikariPool-1 - Shutdown completed.
2024-10-30 15:43:40.551  WARN 50336 --- [                  SimpleAsyncTaskExecutor-119] com.zaxxer.hikari.pool.ProxyConnection  : HikariPool-1 - Connection org.postgresql.jdbc.PgConnection@381db99e marked as broken because of SQLSTATE(08003), ErrorCode(0)

org.postgresql.util.PSQLException: This connection has been closed.
	at org.postgresql.jdbc.PgConnection.checkClosed(PgConnection.java:1009)
	at org.postgresql.jdbc.PgConnection.prepareStatement(PgConnection.java:1857)
	at org.postgresql.jdbc.PgConnection.prepareStatement(PgConnection.java:534)
	at com.zaxxer.hikari.pool.ProxyConnection.prepareStatement(ProxyConnection.java:328)
	at com.zaxxer.hikari.pool.HikariProxyConnection.prepareStatement(HikariProxyConnection.java)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(TransactionAwareDataSourceProxy.java:262)
	at jdk.proxy2/jdk.proxy2.$Proxy148.prepareStatement(Unknown Source)
	at org.apache.ibatis.executor.statement.PreparedStatementHandler.instantiateStatement(PreparedStatementHandler.java:86)
	at org.apache.ibatis.executor.statement.BaseStatementHandler.prepare(BaseStatementHandler.java:88)
	at org.apache.ibatis.executor.statement.RoutingStatementHandler.prepare(RoutingStatementHandler.java:59)
	at org.apache.ibatis.executor.BatchExecutor.doQuery(BatchExecutor.java:90)
	at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:325)
	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:89)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:76)
	at org.camunda.bpm.engine.impl.db.sql.DbSqlSession.lambda$selectOne$3(DbSqlSession.java:130)
	at org.camunda.bpm.engine.impl.util.ExceptionUtil.doWithExceptionWrapper(ExceptionUtil.java:350)
	at org.camunda.bpm.engine.impl.db.sql.DbSqlSession.selectOne(DbSqlSession.java:130)
	at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.selectOne(DbEntityManager.java:185)
	at org.camunda.bpm.engine.impl.persistence.entity.ResourceManager.findResourceByDeploymentIdAndResourceName(ResourceManager.java:45)
	at org.camunda.bpm.engine.impl.cmd.GetDeploymentResourceCmd.execute(GetDeploymentResourceCmd.java:56)
	at org.camunda.bpm.engine.impl.cmd.GetDeploymentResourceCmd.execute(GetDeploymentResourceCmd.java:35)
	at org.camunda.bpm.engine.impl.interceptor.CommandContext.lambda$runWithoutAuthorization$0(CommandContext.java:552)
	at org.camunda.bpm.engine.impl.interceptor.CommandContext.runWithoutAuthorization(CommandContext.java:559)
	at org.camunda.bpm.engine.impl.interceptor.CommandContext.runWithoutAuthorization(CommandContext.java:552)
	at org.camunda.bpm.engine.impl.persistence.deploy.cache.ModelInstanceCache.loadAndCacheBpmnModelInstance(ModelInstanceCache.java:66)
	at org.camunda.bpm.engine.impl.persistence.deploy.cache.ModelInstanceCache.findBpmnModelInstanceForDefinition(ModelInstanceCache.java:50)
	at org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache.findBpmnModelInstanceForProcessDefinition(DeploymentCache.java:117)
	at org.camunda.bpm.engine.impl.ProcessDefinitionQueryImpl.addProcessDefinitionToCacheAndRetrieveDocumentation(ProcessDefinitionQueryImpl.java:392)
	at org.camunda.bpm.engine.impl.ProcessDefinitionQueryImpl.executeList(ProcessDefinitionQueryImpl.java:381)
	at org.camunda.bpm.engine.impl.AbstractQuery.evaluateExpressionsAndExecuteList(AbstractQuery.java:219)
	at org.camunda.bpm.engine.impl.AbstractQuery.executeResult(AbstractQuery.java:168)
	at org.camunda.bpm.engine.impl.AbstractQuery.list(AbstractQuery.java:142)
	at org.camunda.bpm.engine.impl.persistence.deploy.cache.BpmnModelInstanceCache$1.call(BpmnModelInstanceCache.java:62)
	at org.camunda.bpm.engine.impl.persistence.deploy.cache.BpmnModelInstanceCache$1.call(BpmnModelInstanceCache.java:58)
	at org.camunda.bpm.engine.impl.interceptor.CommandContext.runWithoutAuthorization(CommandContext.java:559)
	at org.camunda.bpm.engine.impl.interceptor.CommandContext.runWithoutAuthorization(CommandContext.java:547)
	at org.camunda.bpm.engine.impl.persistence.deploy.cache.BpmnModelInstanceCache.getAllDefinitionsForDeployment(BpmnModelInstanceCache.java:58)
	at org.camunda.bpm.engine.impl.persistence.deploy.cache.ModelInstanceCache.removeAllDefinitionsByDeploymentId(ModelInstanceCache.java:81)
	at org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache.removeDeployment(DeploymentCache.java:329)
	at org.camunda.bpm.engine.impl.application.ProcessApplicationManager.removeProcessApplicationRegistration(ProcessApplicationManager.java:100)
	at org.camunda.bpm.engine.impl.application.ProcessApplicationManager.unregisterProcessApplicationForDeployments(ProcessApplicationManager.java:76)
	at org.camunda.bpm.engine.impl.cmd.UnregisterProcessApplicationCmd.execute(UnregisterProcessApplicationCmd.java:56)
	at org.camunda.bpm.engine.impl.cmd.UnregisterProcessApplicationCmd.execute(UnregisterProcessApplicationCmd.java:32)
	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.lambda$execute$0(SpringTransactionInterceptor.java:72)
	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
	at org.camunda.bpm.engine.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:72)
	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.interceptor.ExceptionCodeInterceptor.execute(ExceptionCodeInterceptor.java:55)
	at org.camunda.bpm.engine.impl.ManagementServiceImpl.unregisterProcessApplication(ManagementServiceImpl.java:127)
	at org.camunda.bpm.container.impl.deployment.UndeployProcessArchiveStep.performOperationStep(UndeployProcessArchiveStep.java:65)
	at org.camunda.bpm.container.impl.spi.DeploymentOperation.execute(DeploymentOperation.java:120)
	at org.camunda.bpm.container.impl.jmx.MBeanServiceContainer.executeDeploymentOperation(MBeanServiceContainer.java:160)
	at org.camunda.bpm.container.impl.spi.DeploymentOperation$DeploymentOperationBuilder.execute(DeploymentOperation.java:216)
	at org.camunda.bpm.container.impl.RuntimeContainerDelegateImpl.undeployProcessApplication(RuntimeContainerDelegateImpl.java:124)
	at org.camunda.bpm.application.AbstractProcessApplication.undeploy(AbstractProcessApplication.java:86)
	at org.camunda.bpm.engine.spring.application.SpringProcessApplication.stop(SpringProcessApplication.java:114)
	at org.camunda.bpm.engine.spring.application.SpringProcessApplication.destroy(SpringProcessApplication.java:124)
	at org.camunda.bpm.spring.boot.starter.SpringBootProcessApplication.destroy(SpringBootProcessApplication.java:107)
	at org.camunda.bpm.engine.spring.application.SpringProcessApplication.onApplicationEvent(SpringProcessApplication.java:99)
	at org.camunda.bpm.engine.spring.application.SpringProcessApplication.onApplicationEvent(SpringProcessApplication.java:52)
	at com.my.application.MyApplicationApplication$$SpringCGLIB$$0.onApplicationEvent(<generated>)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:185)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:178)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.lambda$multicastEvent$0(SimpleApplicationEventMulticaster.java:148)
	at java.base/java.lang.Thread.run(Thread.java:1583)

2024-10-30 15:43:40.556 ERROR 50336 --- [                  SimpleAsyncTaskExecutor-119] org.camunda.bpm.application             : ENGINE-07018 Unregistering process application for deployment but could not remove process definitions from deployment cache.

org.camunda.bpm.engine.ProcessEnginePersistenceException: 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:357)
	at org.camunda.bpm.engine.impl.util.ExceptionUtil.doWithExceptionWrapper(ExceptionUtil.java:352)
	at org.camunda.bpm.engine.impl.db.sql.DbSqlSession.selectOne(DbSqlSession.java:130)
	at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.selectOne(DbEntityManager.java:185)
	at org.camunda.bpm.engine.impl.persistence.entity.ResourceManager.findResourceByDeploymentIdAndResourceName(ResourceManager.java:45)
	at org.camunda.bpm.engine.impl.cmd.GetDeploymentResourceCmd.execute(GetDeploymentResourceCmd.java:56)
	at org.camunda.bpm.engine.impl.cmd.GetDeploymentResourceCmd.execute(GetDeploymentResourceCmd.java:35)
	at org.camunda.bpm.engine.impl.interceptor.CommandContext.lambda$runWithoutAuthorization$0(CommandContext.java:552)
	at org.camunda.bpm.engine.impl.interceptor.CommandContext.runWithoutAuthorization(CommandContext.java:559)
	at org.camunda.bpm.engine.impl.interceptor.CommandContext.runWithoutAuthorization(CommandContext.java:552)
	at org.camunda.bpm.engine.impl.persistence.deploy.cache.ModelInstanceCache.loadAndCacheBpmnModelInstance(ModelInstanceCache.java:66)
	at org.camunda.bpm.engine.impl.persistence.deploy.cache.ModelInstanceCache.findBpmnModelInstanceForDefinition(ModelInstanceCache.java:50)
	at org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache.findBpmnModelInstanceForProcessDefinition(DeploymentCache.java:117)
	at org.camunda.bpm.engine.impl.ProcessDefinitionQueryImpl.addProcessDefinitionToCacheAndRetrieveDocumentation(ProcessDefinitionQueryImpl.java:392)
	at org.camunda.bpm.engine.impl.ProcessDefinitionQueryImpl.executeList(ProcessDefinitionQueryImpl.java:381)
	at org.camunda.bpm.engine.impl.AbstractQuery.evaluateExpressionsAndExecuteList(AbstractQuery.java:219)
	at org.camunda.bpm.engine.impl.AbstractQuery.executeResult(AbstractQuery.java:168)
	at org.camunda.bpm.engine.impl.AbstractQuery.list(AbstractQuery.java:142)
	at org.camunda.bpm.engine.impl.persistence.deploy.cache.BpmnModelInstanceCache$1.call(BpmnModelInstanceCache.java:62)
	at org.camunda.bpm.engine.impl.persistence.deploy.cache.BpmnModelInstanceCache$1.call(BpmnModelInstanceCache.java:58)
	at org.camunda.bpm.engine.impl.interceptor.CommandContext.runWithoutAuthorization(CommandContext.java:559)
	at org.camunda.bpm.engine.impl.interceptor.CommandContext.runWithoutAuthorization(CommandContext.java:547)
	at org.camunda.bpm.engine.impl.persistence.deploy.cache.BpmnModelInstanceCache.getAllDefinitionsForDeployment(BpmnModelInstanceCache.java:58)
	at org.camunda.bpm.engine.impl.persistence.deploy.cache.ModelInstanceCache.removeAllDefinitionsByDeploymentId(ModelInstanceCache.java:81)
	at org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache.removeDeployment(DeploymentCache.java:329)
	at org.camunda.bpm.engine.impl.application.ProcessApplicationManager.removeProcessApplicationRegistration(ProcessApplicationManager.java:100)
	at org.camunda.bpm.engine.impl.application.ProcessApplicationManager.unregisterProcessApplicationForDeployments(ProcessApplicationManager.java:76)
	at org.camunda.bpm.engine.impl.cmd.UnregisterProcessApplicationCmd.execute(UnregisterProcessApplicationCmd.java:56)
	at org.camunda.bpm.engine.impl.cmd.UnregisterProcessApplicationCmd.execute(UnregisterProcessApplicationCmd.java:32)
	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.lambda$execute$0(SpringTransactionInterceptor.java:72)
	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
	at org.camunda.bpm.engine.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:72)
	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.interceptor.ExceptionCodeInterceptor.execute(ExceptionCodeInterceptor.java:55)
	at org.camunda.bpm.engine.impl.ManagementServiceImpl.unregisterProcessApplication(ManagementServiceImpl.java:127)
	at org.camunda.bpm.container.impl.deployment.UndeployProcessArchiveStep.performOperationStep(UndeployProcessArchiveStep.java:65)
	at org.camunda.bpm.container.impl.spi.DeploymentOperation.execute(DeploymentOperation.java:120)
	at org.camunda.bpm.container.impl.jmx.MBeanServiceContainer.executeDeploymentOperation(MBeanServiceContainer.java:160)
	at org.camunda.bpm.container.impl.spi.DeploymentOperation$DeploymentOperationBuilder.execute(DeploymentOperation.java:216)
	at org.camunda.bpm.container.impl.RuntimeContainerDelegateImpl.undeployProcessApplication(RuntimeContainerDelegateImpl.java:124)
	at org.camunda.bpm.application.AbstractProcessApplication.undeploy(AbstractProcessApplication.java:86)
	at org.camunda.bpm.engine.spring.application.SpringProcessApplication.stop(SpringProcessApplication.java:114)
	at org.camunda.bpm.engine.spring.application.SpringProcessApplication.destroy(SpringProcessApplication.java:124)
	at org.camunda.bpm.spring.boot.starter.SpringBootProcessApplication.destroy(SpringBootProcessApplication.java:107)
	at org.camunda.bpm.engine.spring.application.SpringProcessApplication.onApplicationEvent(SpringProcessApplication.java:99)
	at org.camunda.bpm.engine.spring.application.SpringProcessApplication.onApplicationEvent(SpringProcessApplication.java:52)
	at com.my.application.MyApplicationApplication$$SpringCGLIB$$0.onApplicationEvent(<generated>)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:185)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:178)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.lambda$multicastEvent$0(SimpleApplicationEventMulticaster.java:148)
	at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: org.postgresql.util.PSQLException: This connection has been closed.
### The error may exist in org/camunda/bpm/engine/impl/mapping/entity/Resource.xml
### The error may involve org.camunda.bpm.engine.impl.persistence.entity.ResourceEntity.selectResourceByDeploymentIdAndResourceName_postgres
### The error occurred while executing a query
### SQL: select * from ACT_GE_BYTEARRAY      where DEPLOYMENT_ID_ = ?           AND NAME_ = ?
### Cause: org.postgresql.util.PSQLException: This connection has been closed.
	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.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:76)
	at org.camunda.bpm.engine.impl.db.sql.DbSqlSession.lambda$selectOne$3(DbSqlSession.java:130)
	at org.camunda.bpm.engine.impl.util.ExceptionUtil.doWithExceptionWrapper(ExceptionUtil.java:350)
	... 53 common frames omitted
Caused by: org.postgresql.util.PSQLException: This connection has been closed.
	at org.postgresql.jdbc.PgConnection.checkClosed(PgConnection.java:1009)
	at org.postgresql.jdbc.PgConnection.prepareStatement(PgConnection.java:1857)
	at org.postgresql.jdbc.PgConnection.prepareStatement(PgConnection.java:534)
	at com.zaxxer.hikari.pool.ProxyConnection.prepareStatement(ProxyConnection.java:328)
	at com.zaxxer.hikari.pool.HikariProxyConnection.prepareStatement(HikariProxyConnection.java)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(TransactionAwareDataSourceProxy.java:262)
	at jdk.proxy2/jdk.proxy2.$Proxy148.prepareStatement(Unknown Source)
	at org.apache.ibatis.executor.statement.PreparedStatementHandler.instantiateStatement(PreparedStatementHandler.java:86)
	at org.apache.ibatis.executor.statement.BaseStatementHandler.prepare(BaseStatementHandler.java:88)
	at org.apache.ibatis.executor.statement.RoutingStatementHandler.prepare(RoutingStatementHandler.java:59)
	at org.apache.ibatis.executor.BatchExecutor.doQuery(BatchExecutor.java:90)
	at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:325)
	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:89)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)
	... 57 common frames omitted

2024-10-30 15:43:40.559 ERROR 50336 --- [                  SimpleAsyncTaskExecutor-119] org.camunda.bpm.container               : ENGINE-08044 Exception while performing 'Undeploying process archvie null': 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.ProcessEnginePersistenceException: 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:357)
	at org.camunda.bpm.engine.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:83)
	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.interceptor.ExceptionCodeInterceptor.execute(ExceptionCodeInterceptor.java:55)
	at org.camunda.bpm.engine.impl.ManagementServiceImpl.unregisterProcessApplication(ManagementServiceImpl.java:127)
	at org.camunda.bpm.container.impl.deployment.UndeployProcessArchiveStep.performOperationStep(UndeployProcessArchiveStep.java:65)
	at org.camunda.bpm.container.impl.spi.DeploymentOperation.execute(DeploymentOperation.java:120)
	at org.camunda.bpm.container.impl.jmx.MBeanServiceContainer.executeDeploymentOperation(MBeanServiceContainer.java:160)
	at org.camunda.bpm.container.impl.spi.DeploymentOperation$DeploymentOperationBuilder.execute(DeploymentOperation.java:216)
	at org.camunda.bpm.container.impl.RuntimeContainerDelegateImpl.undeployProcessApplication(RuntimeContainerDelegateImpl.java:124)
	at org.camunda.bpm.application.AbstractProcessApplication.undeploy(AbstractProcessApplication.java:86)
	at org.camunda.bpm.engine.spring.application.SpringProcessApplication.stop(SpringProcessApplication.java:114)
	at org.camunda.bpm.engine.spring.application.SpringProcessApplication.destroy(SpringProcessApplication.java:124)
	at org.camunda.bpm.spring.boot.starter.SpringBootProcessApplication.destroy(SpringBootProcessApplication.java:107)
	at org.camunda.bpm.engine.spring.application.SpringProcessApplication.onApplicationEvent(SpringProcessApplication.java:99)
	at org.camunda.bpm.engine.spring.application.SpringProcessApplication.onApplicationEvent(SpringProcessApplication.java:52)
	at com.my.application.MyApplicationApplication$$SpringCGLIB$$0.onApplicationEvent(<generated>)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:185)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:178)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.lambda$multicastEvent$0(SimpleApplicationEventMulticaster.java:148)
	at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: org.springframework.transaction.TransactionSystemException: JDBC commit failed
	at org.springframework.jdbc.datasource.DataSourceTransactionManager.translateException(DataSourceTransactionManager.java:439)
	at org.springframework.jdbc.datasource.DataSourceTransactionManager.doCommit(DataSourceTransactionManager.java:340)
	at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:795)
	at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:758)
	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:152)
	at org.camunda.bpm.engine.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:72)
	... 21 common frames omitted
Caused by: java.sql.SQLException: Connection is closed
	at com.zaxxer.hikari.pool.ProxyConnection$ClosedConnection.lambda$getClosedConnection$0(ProxyConnection.java:503)
	at jdk.proxy3/jdk.proxy3.$Proxy150.commit(Unknown Source)
	at com.zaxxer.hikari.pool.ProxyConnection.commit(ProxyConnection.java:378)
	at com.zaxxer.hikari.pool.HikariProxyConnection.commit(HikariProxyConnection.java)
	at org.springframework.jdbc.datasource.DataSourceTransactionManager.doCommit(DataSourceTransactionManager.java:337)
	... 25 common frames omitted

2024-10-30 15:43:40.560  INFO 50336 --- [                  SimpleAsyncTaskExecutor-119] org.camunda.bpm.container               : ENGINE-08051 Process application my-application undeployed