6

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
Benjamin Gamard
  • 308
  • 3
  • 9
  • I have the same problem when using Kafka Emitter and sending events during the Transactional scope. And also it happens not every time, but each 10-15 invocations. – T_E_M_A Jun 24 '22 at 17:06
  • @T_E_M_A I provided a workaround in this issue: https://github.com/quarkusio/quarkus/issues/21948 – Benjamin Gamard Jun 25 '22 at 18:08

1 Answers1

1

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).

Benjamin Gamard
  • 308
  • 3
  • 9