docker-composejbosswildflyjbpmdb2-luw

Dockerized jBPM with DB2 Fails Upon Docker Restart


Dockerized jBPM with DB2 Fails Upon Docker Restart

Hello Stack Overflow Community,

I've encountered an issue with my Docker container that's running jBPM with a DB2 database. The issue arises specifically when I try to restart the Docker container.

When I start the Docker services for the first time, everything works correctly. The DB2 database creates all of the jBPM tables and I can navigate through localhost:8080/business-central without any issues.

However, when I subsequently restart (stop/start) the jBPM-server container, I encounter a problem. The error message shown below appears in the logs and the option to display "process definition" stops functioning.

I have conducted the same tests using Postgres as the database, and the results were correct, both the first time the container is started and after a restart. I understand that it must be a configuration issue, but I have reviewed the parameters several times and have not been able to figure out where the problem lies.

Here is the error message that appears in the logs:

2023-05-25 16:05:25,905 DEBUG [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (ServerService Thread Pool -- 79) Error accessing table metadata [n/a]: com.ibm.db2.jcc.am.SqlException: [jcc][t4][10120][10898][4.32.28] Invalid operation: result set is closed. ERRORCODE=-4470, SQLSTATE=null
    at com.ibm//com.ibm.db2.jcc.am.b7.a(b7.java:794)
    at com.ibm//com.ibm.db2.jcc.am.b7.a(b7.java:66)
    at com.ibm//com.ibm.db2.jcc.am.b7.a(b7.java:116)
    at com.ibm//com.ibm.db2.jcc.am.ResultSet.checkForClosedResultSet(ResultSet.java:4892)
    at com.ibm//com.ibm.db2.jcc.am.ResultSet.nextX(ResultSet.java:407)
    at com.ibm//com.ibm.db2.jcc.am.ResultSet.next(ResultSet.java:386)
    at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.processTableResults(InformationExtractorJdbcDatabaseMetaDataImpl.java:483)
    at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.locateTableInNamespace(InformationExtractorJdbcDatabaseMetaDataImpl.java:463)
    at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.getTable(InformationExtractorJdbcDatabaseMetaDataImpl.java:215)
    at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.DatabaseInformationImpl.getTableInformation(DatabaseInformationImpl.java:111)
    at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.DatabaseInformationImpl.locateTableInformation(DatabaseInformationImpl.java:148)
    at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.getForeignKeys(InformationExtractorJdbcDatabaseMetaDataImpl.java:821)
    at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.TableInformationImpl.foreignKeys(TableInformationImpl.java:97)
    at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.TableInformationImpl.getForeignKeys(TableInformationImpl.java:91)
    at deployment.kie-server.war//org.hibernate.tool.schema.internal.AbstractSchemaMigrator.checkForExistingForeignKey(AbstractSchemaMigrator.java:471)
    at deployment.kie-server.war//org.hibernate.tool.schema.internal.AbstractSchemaMigrator.applyForeignKeys(AbstractSchemaMigrator.java:423)
    at deployment.kie-server.war//org.hibernate.tool.schema.internal.AbstractSchemaMigrator.performMigration(AbstractSchemaMigrator.java:249)
    at deployment.kie-server.war//org.hibernate.tool.schema.internal.AbstractSchemaMigrator.doMigration(AbstractSchemaMigrator.java:114)
    at deployment.kie-server.war//org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:183)
    at deployment.kie-server.war//org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:72)
    at deployment.kie-server.war//org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:310)
    at deployment.kie-server.war//org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:467)
    at deployment.kie-server.war//org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1250)
    at deployment.kie-server.war//org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:141)
    at deployment.kie-server.war//org.kie.server.services.jbpm.JbpmKieServerExtension.createEntityManagerFactory(JbpmKieServerExtension.java:830)
    at deployment.kie-server.war//org.kie.server.services.jbpm.JbpmKieServerExtension.build(JbpmKieServerExtension.java:823)
    at deployment.kie-server.war//org.kie.server.services.jbpm.JbpmKieServerExtension.configureServices(JbpmKieServerExtension.java:239)
    at deployment.kie-server.war//org.kie.server.services.jbpm.JbpmKieServerExtension.init(JbpmKieServerExtension.java:195)
    at deployment.kie-server.war//org.kie.server.services.impl.KieServerImpl.init(KieServerImpl.java:184)
    at deployment.kie-server.war//org.kie.server.services.impl.KieServerImpl.init(KieServerImpl.java:142)
    at deployment.kie-server.war//org.kie.server.services.impl.KieServerLocator$KieServerLocatorHelper.<clinit>(KieServerLocator.java:25)
    at deployment.kie-server.war//org.kie.server.services.impl.KieServerLocator.getInstance(KieServerLocator.java:32)
    at deployment.kie-server.war//org.kie.server.remote.rest.common.Bootstrap.contextInitialized(Bootstrap.java:51)
    at io.undertow.servlet@2.2.5.Final//io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
    at io.undertow.servlet@2.2.5.Final//io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:219)
    at io.undertow.servlet@2.2.5.Final//io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:187)
    at io.undertow.servlet@2.2.5.Final//io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
    at io.undertow.servlet@2.2.5.Final//io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
    at org.wildfly.extension.undertow@23.0.2.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
    at org.wildfly.extension.undertow@23.0.2.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
    at org.wildfly.extension.undertow@23.0.2.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
    at org.wildfly.extension.undertow@23.0.2.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
    at io.undertow.servlet@2.2.5.Final//io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:255)
    at org.wildfly.extension.undertow@23.0.2.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:96)
    at org.wildfly.extension.undertow@23.0.2.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:78)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at org.jboss.threads@2.4.0.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
    at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
    at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
    at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
    at java.base/java.lang.Thread.run(Thread.java:834)
    at org.jboss.threads@2.4.0.Final//org.jboss.threads.JBossThread.run(JBossThread.java:513)

2023-05-25 16:05:25,917 WARN  [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (ServerService Thread Pool -- 79) SQL Error: -4470, SQLState: null
2023-05-25 16:05:25,917 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (ServerService Thread Pool -- 79) [jcc][t4][10120][10898][4.32.28] Invalid operation: result set is closed. ERRORCODE=-4470, SQLSTATE=null
2023-05-25 16:05:25,919 DEBUG [org.hibernate.internal.SessionFactoryImpl] (ServerService Thread Pool -- 79) HHH000031: Closing
2023-05-25 16:05:25,920 DEBUG [org.hibernate.internal.SessionFactoryRegistry] (ServerService Thread Pool -- 79) Initializing SessionFactoryRegistry : org.hibernate.internal.SessionFactoryRegistry@5d935bc
2023-05-25 16:05:25,920 DEBUG [org.hibernate.type.spi.TypeConfiguration$Scope] (ServerService Thread Pool -- 79) Un-scoping TypeConfiguration [org.hibernate.type.spi.TypeConfiguration$Scope@4c53c80d] from SessionFactory [org.hibernate.internal.SessionFactoryImpl@1be0a099]
2023-05-25 16:05:25,921 DEBUG [org.hibernate.service.internal.AbstractServiceRegistryImpl] (ServerService Thread Pool -- 79) Implicitly destroying ServiceRegistry on de-registration of all child ServiceRegistries
2023-05-25 16:05:25,921 DEBUG [org.hibernate.boot.registry.internal.BootstrapServiceRegistryImpl] (ServerService Thread Pool -- 79) Implicitly destroying Boot-strap registry on de-registration of all child ServiceRegistries
2023-05-25 16:05:25,921 ERROR [org.kie.server.services.impl.KieServerImpl] (ServerService Thread Pool -- 79) Error when initializing server extension of type jBPM KIE Server extension: java.lang.RuntimeException: Unable to create EntityManagerFactory due to [PersistenceUnit: org.jbpm.domain] Unable to build Hibernate SessionFactory
    at deployment.kie-server.war//org.kie.server.services.jbpm.JbpmKieServerExtension.build(JbpmKieServerExtension.java:825)
    at deployment.kie-server.war//org.kie.server.services.jbpm.JbpmKieServerExtension.configureServices(JbpmKieServerExtension.java:239)
    at deployment.kie-server.war//org.kie.server.services.jbpm.JbpmKieServerExtension.init(JbpmKieServerExtension.java:195)
    at deployment.kie-server.war//org.kie.server.services.impl.KieServerImpl.init(KieServerImpl.java:184)
    at deployment.kie-server.war//org.kie.server.services.impl.KieServerImpl.init(KieServerImpl.java:142)
    at deployment.kie-server.war//org.kie.server.services.impl.KieServerLocator$KieServerLocatorHelper.<clinit>(KieServerLocator.java:25)
    at deployment.kie-server.war//org.kie.server.services.impl.KieServerLocator.getInstance(KieServerLocator.java:32)
    at deployment.kie-server.war//org.kie.server.remote.rest.common.Bootstrap.contextInitialized(Bootstrap.java:51)
    at io.undertow.servlet@2.2.5.Final//io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
    at io.undertow.servlet@2.2.5.Final//io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:219)
    at io.undertow.servlet@2.2.5.Final//io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:187)
    at io.undertow.servlet@2.2.5.Final//io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
    at io.undertow.servlet@2.2.5.Final//io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
    at org.wildfly.extension.undertow@23.0.2.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
    at org.wildfly.extension.undertow@23.0.2.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
    at org.wildfly.extension.undertow@23.0.2.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
    at org.wildfly.extension.undertow@23.0.2.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
    at io.undertow.servlet@2.2.5.Final//io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:255)
    at org.wildfly.extension.undertow@23.0.2.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:96)
    at org.wildfly.extension.undertow@23.0.2.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:78)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at org.jboss.threads@2.4.0.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
    at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
    at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
    at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
    at java.base/java.lang.Thread.run(Thread.java:834)
    at org.jboss.threads@2.4.0.Final//org.jboss.threads.JBossThread.run(JBossThread.java:513)
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: org.jbpm.domain] Unable to build Hibernate SessionFactory
    at deployment.kie-server.war//org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:1327)
    at deployment.kie-server.war//org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1253)
    at deployment.kie-server.war//org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:141)
    at deployment.kie-server.war//org.kie.server.services.jbpm.JbpmKieServerExtension.createEntityManagerFactory(JbpmKieServerExtension.java:830)
    at deployment.kie-server.war//org.kie.server.services.jbpm.JbpmKieServerExtension.build(JbpmKieServerExtension.java:823)
    ... 27 more
Caused by: org.hibernate.exception.GenericJDBCException: Error accessing table metadata
    at deployment.kie-server.war//org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47)
    at deployment.kie-server.war//org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113)
    at deployment.kie-server.war//org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:99)
    at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.convertSQLException(InformationExtractorJdbcDatabaseMetaDataImpl.java:98)
    at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.locateTableInNamespace(InformationExtractorJdbcDatabaseMetaDataImpl.java:471)
    at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.getTable(InformationExtractorJdbcDatabaseMetaDataImpl.java:215)
    at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.DatabaseInformationImpl.getTableInformation(DatabaseInformationImpl.java:111)
    at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.DatabaseInformationImpl.locateTableInformation(DatabaseInformationImpl.java:148)
    at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.getForeignKeys(InformationExtractorJdbcDatabaseMetaDataImpl.java:821)
    at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.TableInformationImpl.foreignKeys(TableInformationImpl.java:97)
    at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.TableInformationImpl.getForeignKeys(TableInformationImpl.java:91)
    at deployment.kie-server.war//org.hibernate.tool.schema.internal.AbstractSchemaMigrator.checkForExistingForeignKey(AbstractSchemaMigrator.java:471)
    at deployment.kie-server.war//org.hibernate.tool.schema.internal.AbstractSchemaMigrator.applyForeignKeys(AbstractSchemaMigrator.java:423)
    at deployment.kie-server.war//org.hibernate.tool.schema.internal.AbstractSchemaMigrator.performMigration(AbstractSchemaMigrator.java:249)
    at deployment.kie-server.war//org.hibernate.tool.schema.internal.AbstractSchemaMigrator.doMigration(AbstractSchemaMigrator.java:114)
    at deployment.kie-server.war//org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:183)
    at deployment.kie-server.war//org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:72)
    at deployment.kie-server.war//org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:310)
    at deployment.kie-server.war//org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:467)
    at deployment.kie-server.war//org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1250)
    ... 30 more
Caused by: com.ibm.db2.jcc.am.SqlException: [jcc][t4][10120][10898][4.32.28] Invalid operation: result set is closed. ERRORCODE=-4470, SQLSTATE=null
    at com.ibm//com.ibm.db2.jcc.am.b7.a(b7.java:794)
    at com.ibm//com.ibm.db2.jcc.am.b7.a(b7.java:66)
    at com.ibm//com.ibm.db2.jcc.am.b7.a(b7.java:116)
    at com.ibm//com.ibm.db2.jcc.am.ResultSet.checkForClosedResultSet(ResultSet.java:4892)
    at com.ibm//com.ibm.db2.jcc.am.ResultSet.nextX(ResultSet.java:407)
    at com.ibm//com.ibm.db2.jcc.am.ResultSet.next(ResultSet.java:386)
    at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.processTableResults(InformationExtractorJdbcDatabaseMetaDataImpl.java:483)
    at deployment.kie-server.war//org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.locateTableInNamespace(InformationExtractorJdbcDatabaseMetaDataImpl.java:463)
    ... 45 more

Here is the content of my docker-compose.yml file:

version: '3'
services:
  jbpm-server:
    image: quay.io/kiegroup/jbpm-server-full:7.73.0.Final
    ports:
      - "8001:8001"
      - "8080:8080"
    environment:
      - JBPM_DB_DRIVER=db2
      - JBPM_DB_HOST=db2server
      - JBPM_DB_PORT=50000
      - JBPM_DB_NAME=jbpm
      - JBPM_DB_USER=jbpm
      - JBPM_DB_PASSWORD=password
    volumes:
      - ./configuration/jbpm-db2-config_xa_datasource.cli:/opt/jboss/wildfly/bin/jbpm-db2-config.cli
      - ./drivers/db2jcc4.jar:/opt/jboss/wildfly/bin/drivers/db2jcc4.jar
      
    depends_on:
      - db2server

  db2server:
    image: icr.io/db2_community/db2:11.5.8.0
    hostname: db2server
    privileged: true
    ports:
      - "50000:50000"
    environment:
      - LICENSE=accept
      - DB2INSTANCE=jbpm
      - DB2INST1_PASSWORD=password
      - DBNAME=jbpm
      - BLU=false
      - ENABLE_ORACLE_COMPATIBILITY=false
      - UPDATEAVAIL=NO
      - TO_CREATE_SAMPLEDB=false
      - REPODB=false
      - IS_OSXFS=false
      - PERSISTENT_HOME=true
      - HADR_ENABLED=false
      - ETCD_ENDPOINT=
      - ETCD_USERNAME=
      - ETCD_PASSWORD=

This is the content of my module.xml file under the com.ibm directory:

<?xml version='1.0' encoding='UTF-8'?>

<module xmlns="urn:jboss:module:1.1" name="com.ibm">

    <resources>
        <resource-root path="db2jcc4.jar"/>
    </resources>

    <dependencies>
        <module name="javax.api"/>
        <module name="javax.transaction.api"/>
    </dependencies>
</module>

Finally, here are the datasources from the standalone.xml file that gets generated:

...
                <xa-datasource jndi-name="java:jboss/datasources/jBPMDS" pool-name="jBPMXADS">
                    <xa-datasource-property name="ServerName">
                        db2server
                    </xa-datasource-property>
                    <xa-datasource-property name="DatabaseName">
                        jbpm
                    </xa-datasource-property>
                    <xa-datasource-property name="PortNumber">
                        50000
                    </xa-datasource-property>
                    <xa-datasource-property name="DriverType">
                        4
                    </xa-datasource-property>
                    <xa-datasource-class>com.ibm.db2.jcc.DB2XADataSource</xa-datasource-class>
                    <driver>db2</driver>
                    <xa-pool>
                        <is-same-rm-override>false</is-same-rm-override>
                    </xa-pool>
                    <security>
                        <user-name>jbpm</user-name>
                        <password>password</password>
                    </security>
                    <recovery>
                        <recover-plugin class-name="org.jboss.jca.core.recovery.ConfigurableRecoveryPlugin">
                            <config-property name="EnableIsValid">
                                false
                            </config-property>
                            <config-property name="IsValidOverride">
                                false
                            </config-property>
                            <config-property name="EnableClose">
                                false
                            </config-property>
                        </recover-plugin>
                    </recovery>
                    <validation>
                        <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.db2.DB2ValidConnectionChecker"/>
                        <validate-on-match>true</validate-on-match>
                        <background-validation>true</background-validation>
                        <background-validation-millis>120000</background-validation-millis>
                        <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.db2.DB2ExceptionSorter"/>
                    </validation>
                </xa-datasource>
                <drivers>
                    <driver name="h2" module="com.h2database.h2">
                        <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
                    </driver>
                    <driver name="db2" module="com.ibm">
                        <xa-datasource-class>com.ibm.db2.jcc.DB2XADataSource</xa-datasource-class>
                    </driver>
                </drivers>                
...

I'm trying to simulate a scenario where the DB2 database already exists and has the jBPM database model created.

The first step is to start the containers so that the model in DB2 is created (jBPM does this automatically at startup).

The next step is to verify that by restarting the jBPM-server container, the system continues to function. At this step is where I encountered the error.

Finally, the ultimate test would be to remove the used Docker container and create a new one, which should find the already created database and run correctly.

I've tried several solutions to resolve this issue but none of them have worked so far.

Can anyone provide any insight into what might be causing this issue and how I can resolve it?

Thank you in advance for your help.


Solution

  • the problem seems to be produced for code that is designed for db2 jcc driver prior to jcc4. When a next operation is requested to a closed resulset the exception is throwed.

    You can set this parameter to the datasorce:

    allowNextOnExhaustedResultSet=1
    

    Hope this helps!!!