Skip to content

Configuration property to make transaction mandatory even for read operations #34016

@HerrDerb

Description

@HerrDerb

Description

I recently discovered that I can perform read operations using a Panache repository during a QuarkusTest without an active transaction. This behavior took me by surprise, and it also resulted in incorrect data being returned (possibly due to caching. Unfortunately, I couldn't reproduce the issue with a reproducer). As soon as I put an active transaction around the test, everything works as expected. I attempted to find a configuration option to enforce a transaction for read operations, but I was unable to locate a suitable setting.

It seems that setting the TransactionRequirement to STRICT is not a viable solution for me, as it would prevent the Liquibase migration from executing.

Without putting into question that no transaction is required to read, I would like to propose a new configuration property to be able to enforce transactions even for read operation. This way, everyone can use transactions according to their preferences.

Implementation ideas

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions