hibernate-reactive icon indicating copy to clipboard operation
hibernate-reactive copied to clipboard

transaction isolation level

Open Xset-s opened this issue 3 years ago • 4 comments

Hello, could you tell me, if it is possible to set Transaction Isolation Level in hibernate reactive for some native queries?

Xset-s avatar Jun 26 '21 23:06 Xset-s

Ah yeah, this is a good question. There's no "bottled" way to do it rn, it's something I forgot we had to come back to. I also forget whether the Vert.x guys ended up adding an API for it or whether it has to be done by executing SQL on the connection. Either way, we need to expose that in some way in our APIs.

I will look into this.

gavinking avatar Jun 26 '21 23:06 gavinking

So the issue in Vert.x is this one:

https://github.com/eclipse-vertx/vertx-sql-client/issues/432

If I'm not mistaken, there's not much we can really do here other than wait for them to add this functionality.

Because we're not starting the transaction ourselves, that's buried within the Vert.x API.

gavinking avatar Jul 08 '21 09:07 gavinking

is this still an issue? Given:

emf.withTransaction((session, tx) -> {...});

How do I set the transaction isolation level in {...}?

siddjain avatar Oct 04 '22 17:10 siddjain

Well, on some databases you can do it by executing the appropriate native SQL, for example https://www.postgresql.org/docs/current/sql-set-transaction.html

gavinking avatar Oct 04 '22 19:10 gavinking