Uploaded image for project: 'Agroal'
  1. Agroal
  2. AG-225

Keep error code on BaseXAResource#end()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 2.3
    • 1.18, 2.2
    • narayana
    • None
    • False
    • None
    • False

    Description

      Although error codes were added to XAExceptions thrown in AG-158 there is one specific place where the error code is not propagated. In BaseXAResource#end when an XAException is caught, a new XAException is thrown without the error code from the caught XAException. Therefore specific information that a specific user may require is left out. The error code should be in the thrown XAException, whether it's a rethrow or a new XAException. The cause should also be included.

      For instance, Narayana uses this error code to determine how to proceed. If the error code is one of XA_RB* and the flag was TM_FAIL, then no warning is logged and the TransactionManager will still perform a rollback. With error code 0 (no error code set), the TransactionManager will remove the connection and return a FINISH_ERROR.

      Since this is quite deep in agroal-narayana and there is no way if intercepting or manipulating this from outside in order to work around this problem, it would also be nice to have this fix backported to 1.x. We are implementing agroal in order to be able to upgrade to spring boot 3 / Jakarta EE, so a version of agroal for spring boot 2 / Java EE is necessary for us to implement agroal.

      Attachments

        Issue Links

          Activity

            People

              lbarreiro-1 Luis Barreiro
              kimdlanor Ronald Mik
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: