Uploaded image for project: 'Red Hat build of Apache Camel for Spring Boot'
  1. Red Hat build of Apache Camel for Spring Boot
  2. CSB-2278

jdbc and spring-jdbc transacted() does not work properly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Normal Normal
    • CSB-4.0
    • CSB-4.0
    • None
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • Very Likely
    • 0

      For CSB jdbc and spring-jdbc components transactions do not work properly,

      In spring-jdbc case when

      .transacted()

      is used in route, the exception is raised on reaching that point (see attachment).
      This implies probably some conflict with the defaut resetAutoCommit=true, because if the data source is adjusted with

      .to("spring-jdbc:dataSource?resetAutoCommit=false")
      

      transaction works as should.

      In jdbc case rollback() is just ignored. and ".to("jdbc:dataSource?resetAutoCommit=false")" does not help.

      For reproducers see JdbcITCase and SpringJdbcITCase tests annotated with @Jira("CSB-2278") in a branch sveres-CSB-4.x_CSB-1278-camel-jdbc (or later CSB-4.x)
      The command for test run is:

      mvn clean verify -ntp -fn -Pspringboot --projects org.jboss.fuse.tnb.tests.universal:components --also-make --also-make-dependents -Dit.test=SpringJdbcITCase -Dtest.credentials.file=credentials.yaml -Drerun.failing.tests.count=0
      

              fmariani@redhat.com Federico Mariani
              sveres@redhat.com Stefan Veres (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: