That's perfect Lukas, thanks. I don't know that I've ever done anything interesting with Configuration other than bootstrap it, create a DSLContext and forget about it. Is there a blog post or anything that talks about the valuable things I could do with a configuration within a Transaction function?
On Friday, May 19, 2017 at 1:22:48 PM UTC-7, Lukas Eder wrote: > > > > 2017-05-19 18:08 GMT+02:00 <[email protected] <javascript:>>: > >> 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.
