quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.73k stars 2.67k forks source link

Transaction Manager Recovery fails to start with SQLServer DevService #36938

Closed gastaldi closed 11 months ago

gastaldi commented 11 months ago

Describe the bug

When using MSSQL Server DevServices and enabling XA + the transaction recovery mechanism I see the following warning in the logs:

2023-11-08 00:44:36,774 WARN  [com.arj.ats.jta] (DTPMAIN) ARJUNA016027: Local XARecoveryModule.xaRecovery got XA exception XAException.XAER_RMERR: javax.transaction.xa.XAException: com.microsoft.sqlserver.jdbc.SQLServerException: Failed to create the XA control connection. Error: "Could not find stored procedure 'master..xp_sqljdbc_xa_init_ex'."
    at com.microsoft.sqlserver.jdbc.SQLServerXAResource.dtc_XA_interface(SQLServerXAResource.java:775)
    at com.microsoft.sqlserver.jdbc.SQLServerXAResource.recover(SQLServerXAResource.java:856)
    at io.agroal.narayana.RecoveryXAResource.recover(RecoveryXAResource.java:31)
    at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.xaRecoveryFirstPass(XARecoveryModule.java:711)
    at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.periodicWorkFirstPass(XARecoveryModule.java:225)
    at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.periodicWorkFirstPass(XARecoveryModule.java:167)
    at com.arjuna.ats.internal.jta.transaction.arjunacore.jca.XATerminatorImple.recover(XATerminatorImple.java:328)

Expected behavior

No errors

Actual behavior

Error above

How to Reproduce?

  1. Create an app depending on the io.quarkus:quarkus-jdbc-mssql extension (don't forget to place the container-acceptance.txt file in src/test/resources)
  2. Add quarkus.transaction-manager.enable-recovery=true and quarkus.datasource.jdbc.transactions=xa to the application.properties
  3. Create a simple entity and persist in a @Transactional method
  4. mvn clean test

Output of uname -a or ver

macOS m1

Output of java -version

JDK 17

Quarkus version or git rev

3.5.0

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.9.2

Additional information

No response

quarkus-bot[bot] commented 11 months ago

/cc @geoand (devservices), @stuartwdouglas (devservices)

mmusgrov commented 11 months ago

@gastaldi I think this one may be a duplicate of #35336 where the advice was to install a stored procedure (sp_sqljdbc_xa_install).

gastaldi commented 11 months ago

Duplicate of #35336