As per this post, jOOQ implements the transaction propagation mode NESTED by default:
Is it possible to set the propagation mode for a specific transaction to something else?
I used Spring's TransactionTemplate
and it works fine:
transactionTemplate.propagationBehavior = TransactionDefinition.PROPAGATION_REQUIRES_NEW
transactionTemplate.execute {
dslContext.truncate(OUTBOX).execute()
}
But is it also possible by purely using jOOQ API? Something like:
dslContext.transaction { cfg ->
cfg.set(Settings()/* do something */)
}
You can implement your own TransactionProvider
to override jOOQ's out of the box behaviour, or use DefaultTransactionProvider
with the nested
property set to false
:
configuration.set(new DefaultTransactionProvider(connectionProvider, false));