Open jendib opened 3 years ago
Enforcement of transaction isolation levels is not under the control of the narayana transaction manager, instead it is enforced by the connection pooling (so either Agroal or vert.x). @geoand is there a better area by which we can track this issue?
I'll just file it under persistence.
My app is separated between read only API endpoints (high traffic) and write API endpoints (low traffic), so it would be very useful to have
serializable
isolation level for the write endpoints and default (read uncommitted
) isolation level for read only endpoints.
Thinking out loud, one way to work around this is to create 2 Datasources and set the quarkus.datasource.jdbc.transaction-isolation-level=SERIALIZABLE
for the Datasource consumed in the write endpoints.
Description
In Spring, I could change the transaction isolation level in their
@Transactional
annotation (please see https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/transaction/annotation/Transactional.html) however Quarkus is using the Java EE annotation which doesn't permit isolation level configuration.My app is separated between read only API endpoints (high traffic) and write API endpoints (low traffic), so it would be very useful to have
serializable
isolation level for the write endpoints and default (read uncommitted
) isolation level for read only endpoints.Implementation ideas
Quarkus already has a
TransactionConfiguration
annotation to configure transaction timeout, it would be a good idea to add an isolation level configuration there.