Transactions
Among other benefits, transactions give us the ACID properties. We can distinguish between read-only and read-write transactions, different isolation levels, different propagation strategies, and so on. While Spring Boot supports a comprehensive transactional API (Spring TX) that's commonly used via @Transactional
and TransactionTemplate
, jOOQ comes with a simple transaction API (and an org.jooq.TransactionProvider
SPI) that fits perfectly in the context of fluent style.
The following diagram highlights the main implementations of this SPI:
Starting with jOOQ 3.17 we have support for transactions in R2DBC as well. So, jOOQ 3.17 come with support for reactive transactions.
Mainly, the jOOQ API for blocking transactions can be used like so:
ctx.transaction(configuration -> { DSL.using(configuration)... // or, configuration.dsl()... } var result = ctx.transactionResult...