Hooking reactive transactions
As mentioned earlier, starting with jOOQ 3.17, we can take advantage of reactive transactions or transactions in R2DBC. Reactive transactions are easy to use via Publisher
, as they have the same semantics as JDBC’s blocking APIs Here is an example of how to write a nested reactive transaction:
Flux<?> flux = Flux.from( ctx.transactionPublisher(outer -> Flux.from( DSL.using(outer).delete(SALE) // or, outer.dsl() .where(SALE.SALE_ID.eq(2L))) .thenMany(Flux.from( DSL.using(outer).transactionPublisher( // or, outer.dsl() inner -> Flux.from( DSL.using(inner).insertInto(TOKEN) // or, inner.dsl() ...