3 Replies Latest reply on Jan 29, 2020 4:45 AM by ochaloup

    Transaction is already completed - do not call commit or rollback more than once per transaction when using narayana transaction manager with kie-server-spring-boot-starter and SQL server 2017. It works for for other databases like mysql and postgres sql

    shuchitaprasad

      Properties are

       

       

      spring.datasource.username=sa

      spring.datasource.password=reallyStrongPwd123

      spring.datasource.url=jdbc:sqlserver://localhost;databaseName=jbpm

      spring.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver

       

       

       

      #hibernate configuration

      spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.SQLServer2012Dialect

      spring.jpa.properties.hibernate.show_sql=false

      spring.jpa.properties.hibernate.hbm2ddl.auto=none

      spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl

       

       

       

      #transaction manager configuration

      spring.jta.narayana.transaction-manager-id=1

       

       

       

      spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true

       

      versions are kie-server-spring-boot-starter - 7.26.0.Final

       

      narayana --  5.9.0.Final

       

      Logs

       

       

      org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'processFIDataFile': Unsatisfied dependency expressed through field 'runtimeDataService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'runtimeDataService' defined in class path resource [org/jbpm/springboot/autoconfigure/JBPMAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.jbpm.services.api.RuntimeDataService]: Factory method 'runtimeDataService' threw exception; nested exception is java.lang.RuntimeException: Could not commit session or rollback

        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:596) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:374) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1378) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:575) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:846) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:863) ~[spring-context-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546) ~[spring-context-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142) ~[spring-boot-2.1.1.RELEASE.jar!/:2.1.1.RELEASE]

        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [spring-boot-2.1.1.RELEASE.jar!/:2.1.1.RELEASE]

        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.1.1.RELEASE.jar!/:2.1.1.RELEASE]

        at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [spring-boot-2.1.1.RELEASE.jar!/:2.1.1.RELEASE]

        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) [spring-boot-2.1.1.RELEASE.jar!/:2.1.1.RELEASE]

        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) [spring-boot-2.1.1.RELEASE.jar!/:2.1.1.RELEASE]

        at com.mastercard.labs.Application.main(Application.java:16) [classes!/:1.0-SNAPSHOT]

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_232]

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_232]

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_232]

        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_232]

        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [jack-henry-service-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]

        at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [jack-henry-service-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]

        at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) [jack-henry-service-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]

        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) [jack-henry-service-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]

      Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'runtimeDataService' defined in class path resource [org/jbpm/springboot/autoconfigure/JBPMAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.jbpm.services.api.RuntimeDataService]: Factory method 'runtimeDataService' threw exception; nested exception is java.lang.RuntimeException: Could not commit session or rollback

        at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:627) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:607) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1288) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1127) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:538) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:273) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1237) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1164) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:593) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        ... 27 common frames omitted

      Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.jbpm.services.api.RuntimeDataService]: Factory method 'runtimeDataService' threw exception; nested exception is java.lang.RuntimeException: Could not commit session or rollback

        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:622) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        ... 40 common frames omitted

      Caused by: java.lang.RuntimeException: Could not commit session or rollback

        at org.jbpm.services.task.persistence.TaskTransactionInterceptor.rollbackTransaction(TaskTransactionInterceptor.java:123) ~[jbpm-human-task-jpa-7.26.0.Final.jar!/:7.26.0.Final]

        at org.jbpm.services.task.persistence.TaskTransactionInterceptor.execute(TaskTransactionInterceptor.java:108) ~[jbpm-human-task-jpa-7.26.0.Final.jar!/:7.26.0.Final]

        at org.jbpm.services.task.persistence.TaskTransactionInterceptor.execute(TaskTransactionInterceptor.java:49) ~[jbpm-human-task-jpa-7.26.0.Final.jar!/:7.26.0.Final]

        at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:39) ~[drools-core-7.26.0.Final.jar!/:7.26.0.Final]

        at org.drools.persistence.jta.TransactionLockInterceptor.execute(TransactionLockInterceptor.java:73) ~[drools-persistence-api-7.26.0.Final.jar!/:7.26.0.Final]

        at org.drools.persistence.jta.TransactionLockInterceptor.execute(TransactionLockInterceptor.java:45) ~[drools-persistence-api-7.26.0.Final.jar!/:7.26.0.Final]

        at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:39) ~[drools-core-7.26.0.Final.jar!/:7.26.0.Final]

        at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.internalExecute(OptimisticLockRetryInterceptor.java:102) ~[drools-persistence-jpa-7.26.0.Final.jar!/:7.26.0.Final]

        at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.execute(OptimisticLockRetryInterceptor.java:83) ~[drools-persistence-jpa-7.26.0.Final.jar!/:7.26.0.Final]

        at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.execute(OptimisticLockRetryInterceptor.java:44) ~[drools-persistence-jpa-7.26.0.Final.jar!/:7.26.0.Final]

        at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:39) ~[drools-core-7.26.0.Final.jar!/:7.26.0.Final]

        at org.jbpm.runtime.manager.impl.error.ExecutionErrorHandlerInterceptor.internalExecute(ExecutionErrorHandlerInterceptor.java:66) ~[jbpm-runtime-manager-7.26.0.Final.jar!/:7.26.0.Final]

        at org.jbpm.runtime.manager.impl.error.ExecutionErrorHandlerInterceptor.execute(ExecutionErrorHandlerInterceptor.java:52) ~[jbpm-runtime-manager-7.26.0.Final.jar!/:7.26.0.Final]

        at org.jbpm.runtime.manager.impl.error.ExecutionErrorHandlerInterceptor.execute(ExecutionErrorHandlerInterceptor.java:29) ~[jbpm-runtime-manager-7.26.0.Final.jar!/:7.26.0.Final]

        at org.drools.core.runtime.InternalLocalRunner.execute(InternalLocalRunner.java:37) ~[drools-core-7.26.0.Final.jar!/:7.26.0.Final]

        at org.drools.core.runtime.InternalLocalRunner.execute(InternalLocalRunner.java:41) ~[drools-core-7.26.0.Final.jar!/:7.26.0.Final]

        at org.jbpm.services.task.commands.TaskCommandExecutorImpl.execute(TaskCommandExecutorImpl.java:49) ~[jbpm-human-task-core-7.26.0.Final.jar!/:7.26.0.Final]

        at org.jbpm.services.task.impl.TaskDeadlinesServiceImpl.initialize(TaskDeadlinesServiceImpl.java:457) ~[jbpm-human-task-core-7.26.0.Final.jar!/:7.26.0.Final]

        at org.jbpm.services.task.HumanTaskConfigurator.getTaskService(HumanTaskConfigurator.java:166) ~[jbpm-human-task-core-7.26.0.Final.jar!/:7.26.0.Final]

        at org.jbpm.springboot.autoconfigure.JBPMAutoConfiguration.runtimeDataService(JBPMAutoConfiguration.java:351) ~[jbpm-spring-boot-autoconfiguration-7.26.0.Final.jar!/:7.26.0.Final]

        at org.jbpm.springboot.autoconfigure.JBPMAutoConfiguration$$EnhancerBySpringCGLIB$$d33a89b5.CGLIB$runtimeDataService$20(<generated>) ~[jbpm-spring-boot-autoconfiguration-7.26.0.Final.jar!/:7.26.0.Final]

        at org.jbpm.springboot.autoconfigure.JBPMAutoConfiguration$$EnhancerBySpringCGLIB$$d33a89b5$$FastClassBySpringCGLIB$$1a9018ef.invoke(<generated>) ~[jbpm-spring-boot-autoconfiguration-7.26.0.Final.jar!/:7.26.0.Final]

        at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:363) ~[spring-context-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        at org.jbpm.springboot.autoconfigure.JBPMAutoConfiguration$$EnhancerBySpringCGLIB$$d33a89b5.runtimeDataService(<generated>) ~[jbpm-spring-boot-autoconfiguration-7.26.0.Final.jar!/:7.26.0.Final]

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_232]

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_232]

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_232]

        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_232]

        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        ... 41 common frames omitted

      Caused by: java.lang.RuntimeException: Unable to rollback transaction

        at org.kie.spring.persistence.KieSpringTransactionManager.rollback(KieSpringTransactionManager.java:96) ~[kie-spring-7.26.0.Final.jar!/:7.26.0.Final]

        at org.jbpm.services.task.persistence.TaskTransactionInterceptor.rollbackTransaction(TaskTransactionInterceptor.java:120) ~[jbpm-human-task-jpa-7.26.0.Final.jar!/:7.26.0.Final]

        ... 70 common frames omitted

      Caused by: org.springframework.transaction.IllegalTransactionStateException: Transaction is already completed - do not call commit or rollback more than once per transaction

        at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:807) ~[spring-tx-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]

        at org.kie.spring.persistence.KieSpringTransactionManager.rollback(KieSpringTransactionManager.java:87) ~[kie-spring-7.26.0.Final.jar!/:7.26.0.Final]

        ... 71 common frames omitted

       

       

       

       

       

       

        • 1. Re: Transaction is already completed - do not call commit or rollback more than once per transaction when using narayana transaction manager with kie-server-spring-boot-starter and SQL server 2017. It works for for other databases like mysql and postgres
          ochaloup

          HI shuchitaprasad ,

           

          could you please elaborate a bit more what is the trouble you experience? If you be so kind and add some more context what application you are developing and what this exception causes for you?

           

          From what you posted I understand that you experience an exception when a transaction is to be rolled-back several times. Is that your application that invokes the rollback? Is the issue that the {{RuntimeException}} is thrown?

          In fact the {{RuntimeException}} is thrown by the KIE transaction manager wrapper class (droolsjbpm-integration/KieSpringTransactionManager.java at 7.31.0.Final · kiegroup/droolsjbpm-integration · GitHub ). This class does not depend on the underlying JTA implementation - aka. if does not matter if it's Narayana and this question could not be related to the Narayana at all.

           

          From your post is not clear what is the situation where the rollback is called from.

          As an example by JTA spec - UserTransaction (Java(TM) EE 7 Specification APIs)  - you can't try to call rollback if the thread is not associated with an transaction - ({{IllegalStateException}} is thrown). It's probably not the case here but I want to emphasize that calling rollback several times or just by chance means the system could be in state that an exception is thrown as a valid response to the developer action.

           

          You declare that you don't have the same issue with PostgreSQL and MySQL. Then it could be e.g. some issue of JDBC driver.

           

          Ondra

          • 2. Re: Transaction is already completed - do not call commit or rollback more than once per transaction when using narayana transaction manager with kie-server-spring-boot-starter and SQL server 2017. It works for for other databases like mysql and postgres
            shuchitaprasad

            Hi ochaloup,

            I am trying to set up a jbpm  spring boot with MS SQL as database. You are right that the issue is nothing related to narayana transacation.

            When I create a plain spring boot project with MS SQL as database, the start up is clean and it works perfectly fine.

            The moment I add below dependency for kie server , I encounter the exception.

             

            Please find the pom.xml.

            <?xml version="1.0" encoding="UTF-8"?>
            <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
              <modelVersion>4.0.0</modelVersion>
              <parent>
              <groupId>org.springframework.boot</groupId>
              <artifactId>spring-boot-starter-parent</artifactId>
              <version>2.1.1.RELEASE</version>
              <relativePath/> <!-- lookup parent from repository -->
               </parent>
              <groupId>com.example</groupId>
              <artifactId>springboot-withsqlserver</artifactId>
              <version>0.0.1-SNAPSHOT</version>
              <name>springboot-withsqlserver</name>
              <description>Demo project for Spring Boot</description>

              <properties>
              <java.version>1.8</java.version>
              <version.org.kie>7.26.0.Final</version.org.kie>
              </properties>

              <dependencies>

              <dependency>
              <groupId>org.springframework.boot</groupId>
              <artifactId>spring-boot-starter-data-jpa</artifactId>
              </dependency>

              <dependency>
              <groupId>org.kie</groupId>
              <artifactId>kie-server-spring-boot-starter</artifactId>
              <version>${version.org.kie}</version>
              </dependency>




              <dependency>
              <groupId>org.springframework.boot</groupId>
              <artifactId>spring-boot-starter-web</artifactId>
              </dependency>
              <dependency>
              <groupId>com.microsoft.sqlserver</groupId>
              <artifactId>mssql-jdbc</artifactId>
              <scope>runtime</scope>
              </dependency>

              <dependency>
              <groupId>org.springframework.boot</groupId>
              <artifactId>spring-boot-starter-test</artifactId>
              <scope>test</scope>
              </dependency>


              <dependency>
              <groupId>com.h2database</groupId>
              <artifactId>h2</artifactId>
              <scope>test</scope>
              </dependency>
              </dependencies>

              <build>
              <plugins>
              <plugin>
              <groupId>org.springframework.boot</groupId>
              <artifactId>spring-boot-maven-plugin</artifactId>
              </plugin>
              </plugins>
              </build>

            </project>

            The properties file is

             

            server.address=0.0.0.0
            server.port=8080

            cxf.path=/rest

            #kie server config
            kieserver.serverId=jbpm-service
            kieserver.serverName=jbpm-service
            kieserver.location=http://localhost:8080/rest/server
            #kieserver.controllers=


            #kie server capabilities
            kieserver.drools.enabled=false
            kieserver.dmn.enabled=true
            kieserver.jbpm.enabled=true
            kieserver.jbpmui.enabled=true
            kieserver.casemgmt.enabled=true
            #kieserver.prometheus.enabled=true



            #jbpm configuration
            jbpm.executor.enabled=false



            #data source configuration
            spring.datasource.username=sa
            spring.datasource.password=reallyStrongPwd123
            #spring.datasource.url=jdbc:sqlserver://localhost:1433;databaseName=jbpmtest
            spring.datasource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver



            #hibernate configuration
            spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.SQLServer2012Dialect

            • 3. Re: Transaction is already completed - do not call commit or rollback more than once per transaction when using narayana transaction manager with kie-server-spring-boot-starter and SQL server 2017. It works for for other databases like mysql and postgres
              ochaloup

              Hi shuchitaprasad ,

               

              as I looking at the stacktrace once again I think the issue is somewhere at integration of Kie and Spring or in your application which wrongly uses the Kie/jBPM principles.

               

              If you check the stack trace

              Caused by: org.springframework.transaction.IllegalTransactionStateException: Transaction is already completed - do not call commit or rollback more than once per transaction
                at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:807) ~[spring-tx-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
                at org.kie.spring.persistence.KieSpringTransactionManager.rollback(KieSpringTransactionManager.java:87) ~[kie-spring-7.26.0.Final.jar!/:7.26.0.Final]
                ... 71 common frames omitted

               

              the cause came from KieSpringTransactionManager.rollback which is passed to Spring's AbstractPlatformTransactionManager. As the rollback occurs for the second time the transaction manager implementation decides (and it seems correctly) to throw an exception.

               

              Really, I can't see any transactional issue here. Try to verify your business logic logic and the rules you defines for jBPM. I worry that it could be the problem. Or ask directly the jBPM question here: jBPM

               

              Ondra