Describe the issue
When running an XA transaction via quarkus/narayana-jta and the prepare fails (e.g. due to deferred constraint violations), the subsequent abort of the transaction leads to an attempted rollback prepared, which then fails (prepared transaction does not exist), thus raising a HeuristicMixedException.
This is misleading, since the transaction was already rolled back when the prepare failed.
Driver Version?
42.6.0
Java Version?
openjdk version "17.0.10" 2024-01-16
OpenJDK Runtime Environment Temurin-17.0.10+7 (build 17.0.10+7)
OpenJDK 64-Bit Server VM Temurin-17.0.10+7 (build 17.0.10+7, mixed mode, sharing)
OS Version?
Ubuntu 22.04
PostgreSQL Version?
16.1
To Reproduce
run this test (e.g. via gradle test)
Expected behaviour
The transaction rollback (due to problems during the prepare of a participant) should not seem to cause a HeuristicMixedException.
Logs
postgres_2_1 | 2024-02-11 19:01:01.603 UTC [144] LOG: execute <unnamed>:
ROLLBACK PREPARED
'131077_AAAAAAAAAAAAAP//fwABAQAAm5NlyRltAAAAGHF1YXJrdXM=_AAAAAAAAAAAAAP//
fwABAQAAm5NlyRltAAAAIAAAAAAAAAAA'
postgres_2_1 | 2024-02-11 19:01:01.603 UTC [144] ERROR: prepared transaction
with identifier
"131077_AAAAAAAAAAAAAP//fwABAQAAm5NlyRltAAAAGHF1YXJrdXM=_AAAAAAAAAAAAAP//fwABAQAAm5NlyRltAAAAIAAAAAAAAAAA"
does not exist
Describe the issue
When running an XA transaction via quarkus/narayana-jta and the
preparefails (e.g. due to deferred constraint violations), the subsequent abort of the transaction leads to an attemptedrollback prepared, which then fails (prepared transaction does not exist), thus raising aHeuristicMixedException.This is misleading, since the transaction was already rolled back when the
preparefailed.Driver Version?
42.6.0
Java Version?
openjdk version "17.0.10" 2024-01-16
OpenJDK Runtime Environment Temurin-17.0.10+7 (build 17.0.10+7)
OpenJDK 64-Bit Server VM Temurin-17.0.10+7 (build 17.0.10+7, mixed mode, sharing)
OS Version?
Ubuntu 22.04
PostgreSQL Version?
16.1
To Reproduce
run this test (e.g. via
gradle test)Expected behaviour
The transaction rollback (due to problems during the
prepareof a participant) should not seem to cause aHeuristicMixedException.Logs