2017-05-19 18:08 GMT+02:00 <[email protected]>:

> Sorry if this has been asked before, but I have two basic questions.
>
> 1. Why do the functions for the transaction methods take a config instead
> of a DSLContext? Couldn't you have just gotten the DSLContext internally
> with DSL.using(config) so that the transaction function to execute just had
> the DSLContext?
>

While the DSLContext type is quite useful to your SQL building usage,
Configuration is really the "interesting" type behind the scenes. It would
be a bit weird for DSLContext to be an argument type for any jOOQ SPI
method.

In hindsight, it might have been interesting to introduce a
TransactionContext that would give access to Configuration and, perhaps,
DSLContext.


> 2. Is there a way to use these methods so that instead of creating nested
> transaction when one is called from another that they reference count?
>

Yes, you can implement your own TransactionProvider SPI for this purpose.
Or use the DefaultTransactionProvider(ConnectionProvider, boolean)
constructor to avoid nested transactions:
https://www.jooq.org/javadoc/latest/org/jooq/impl/DefaultTransactionProvider.html#DefaultTransactionProvider-org.jooq.ConnectionProvider-boolean-

Hope this helps,
Lukas

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to