Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-11543

EJB transactional method unable to commit when invoked from CDI bean with MariaDB

    XMLWordPrintable

Details

    Description

      Issue cloned from the community forum for tracking.

      Hello,

      We are having issues after deploying our application in the latest Wildfly 15.0.0 Final recently released with the following exception:

      java.sql.SQLException: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state

      The error occurs when our code calls a transactional EJB method that itself calls a couple more injected SessionBean that handles the database persistence through an EntityManager

      The issue only seems to affect the MariaDB port and not oracle.

      I have hit the same problem, migrated from Wildfly 10.0.0. to 15.0.0, using MySQL, same error, similar situation, cdi managed bean that invokes 2 EJBs that use different persistent units. I dont seem to have the problem in 14.0.1 either.

      Another error that has surfaced is this (apologies for the weird formatting but struggled to define a simple type-up without cluttering)

      "javax.persistence.TransactionRequiredException: no transaction is in progress"

      Managed bean with injected ejb (with datasource2) and injected entitymanager for datasource1, code is nested as follows

      Managed bean method save @Transactional(value = TxType.REQUIRED)

      {

      ejb save @TransactionAttribute(TransactionAttributeType.MANDATORY)

      Unknown macro: { persist flush }

      find with lock => LockModeType.PESSIMISTIC_WRITE at this point the "no transaction is in progress" exception is fired

      }

      Did notice that error does not occur if the invocation is purely ejb rather that cdi managed bean

      Attachments

        1. logs.zip
          21 kB
        2. server-trace.zip
          15 kB

        Issue Links

          Activity

            People

              smarlow1@redhat.com Scott Marlow
              mjurc@redhat.com Michal Jurc
              Martin Simka Martin Simka
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: