Random "Enlisted connection used without active transaction" errors

2.2k views Asked by At

In my Quarkus app I get Enlisted connection used without active transaction errors around once a day (on a public API used quite a lot).

It seems to come from Agroal (here https://github.com/agroal/agroal/blob/master/agroal-pool/src/main/java/io/agroal/pool/ConnectionHandler.java#L393).

According to the stack trace it fails at various places in REST endpoints annotated with @Transactional.

In PostgreSQL I only get the following:

ERROR:  canceling statement due to user request
1

There are 1 answers

0
Benjamin Gamard On BEST ANSWER

I worked around this issue by firing an event which is listened in a TransactionPhase.AFTER_SUCCESS method (and this method send the Kafka message).