For those I pass the DSLContext from within the transaction to the method as an 
argument. That way I don’t nest transactions. 

Sent from my iPhone

> On Feb 23, 2018, at 4:08 PM, Ed Erwin <enwi...@gmail.com> wrote:
> 
> Thanks Robert.
> 
> That is pretty cool.  But it seems to be hard to use correctly for nested 
> transactions or any other case where the function you pass to "apply" needs 
> to call subroutines.  You could pass your "Transactor" to subroutines giving 
> them access to your original DSLContext, but they wouldn't have access to the 
> special instance of Configuration that was created when you called 
> "ctx.transaction(....)", so they might not be running in the same transaction.
> 
> That is the problem I'm trying to solve.  Many of my database manipulation 
> routines can be broken down into a series of smaller actions which I put into 
> subroutines and I want to make sure those happen in the same transaction.
> 
> 
>> On Friday, February 23, 2018 at 3:53:23 PM UTC-8, Robert DiFalco wrote:
>> One of the problems I had with the JOOQ transaction approach is that I could 
>> not enforce that users only make SQL calls through a transaction. I solved 
>> it by making this little class. 
> 
> -- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "jOOQ User Group" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/jooq-user/FeXUH-yTUQc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> jooq-user+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 jooq-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to