Starting a Serializable Transaction in Jooq?

350 views
Skip to first unread message

Kamal raj

unread,
Aug 16, 2017, 11:11:53 AM8/16/17
to jOOQ User Group
Hello, 

I'm trying to start a serializable transaction in Postgres. I'm wondering how to do this in Jooq. I could able to see only the documentation of starting a normal transaction, however I need serializable transaction in specific. Also, I need to understand how one can recover from the errors during the transaction. 



Lukas Eder

unread,
Aug 16, 2017, 4:12:28 PM8/16/17
to jooq...@googlegroups.com
Hi Kamal,

There's currently no jOOQ API support for specifying the transaction isolation. The relevant feature request is here:

If you're backing your transaction implementation to JDBC based transactions (as opposed to JTA transactions or Spring TX, for instance), you can implement your own ConnectionProvider or DataSource, which sets the Connection.setTransactionIsolation() value right after obtaining the connection, for instance:

Of course, it is perfectly possible not to use the jOOQ transaction API in case of which you would specify the isolation directly on your transaction provider, and pass jOOQ an already transacted JDBC Connection.

I hope this helps,
Lukas

2017-08-16 17:11 GMT+02:00 Kamal raj <kamalra...@gmail.com>:
Hello, 

I'm trying to start a serializable transaction in Postgres. I'm wondering how to do this in Jooq. I could able to see only the documentation of starting a normal transaction, however I need serializable transaction in specific. Also, I need to understand how one can recover from the errors during the transaction. 



--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages