2014-12-11 15:14 GMT+01:00 Garret Wilson <[email protected]>: > On 12/11/2014 7:15 AM, Lukas Eder wrote: > > ... > > So, I know you said that your project is in a bit of a hurry and that > you're lazy, etc :-) > > > Yes, the project is in too much of a hurry and it's understaffed, etc. But > one point I think you missed is the part where I mentioned, "I'm reviewing > code of a colleague". :) (In fact this isn't even my part of the project; I > merely introduced jOOQ and then handed it over to my colleague. Now I'm > doing a code review.) >
Yeah, I got that part and I smirked. It's always "them colleagues", right? http://www.osnews.com/story/19266/WTFs_m ;-) > ... > Well, I still don't know how you created that DataSource and I thus don't > know why you're assuming that it is creating a new Connection every time > for jOOQ. It might be. But that's the DataSource's responsibility, not > jOOQ's. So again, how **did** you implement that DataSource? (And why > don't you use some connection pool?) > > > > The other part you may have missed is that the exact configuration is > hypothetical, removing all other variables (such as connection pooling, > etc.) just so that I can understand how jOOQ works and fully evaluate my > colleague's code. > > The main point I was trying to make is the following: the only way my > colleague's code works with jOOQ after setting autocommit manually on a > manually-retrieved connection, is that my colleague's code passes around > the connection and forms new DSLContext instances directly from that > connection. > Correct. But then, there's no real point in having that original Configuration anymore. > If this code were to instead create new DSLContext instances from the jOOQ > configuration (which in turn is formed directly from the data source, as > per my hypothetical code at the start of this thread), for each command > those new DSLContext instances would request anew a connection directly > from the data source, which isn't guaranteed to be the connection on which > autocommit was set (and which isn't part of the transaction), so that > wouldn't work. > So I understand jOOQ (and indeed Spring and JavaEE and ULTM) connection > usage much better now from this discussion by considering this hypothetical > configuration. Thanks for bearing with me; it was very helpful. > You're welcome! -- 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.
