On 12/10/2014 2:12 PM, Lukas Eder wrote:

Just checking, have you already used a debugger to step through all the jOOQ / ULTM code, etc?

Lukas, I confess I haven't. Things have been crazy with several projects flying around, and today I'm a little extra lazy because it's my birthday.



    Lukas, if I do /not/ use ULTM, and if I manually turn off
    autocommit on a connection and then issue several jOOQ SQL
    commands, will jOOQ (via the DataSourceConnectionProvider) request
    a different connection for each command?


Where would you turn off autocommit manually, if you use a DataSource? Did you implement your own DataSource?

I'm reviewing code of a colleague, and it looks like this:

connection = dslContext.configuration().connectionProvider().acquire();
connection.setAutoCommit(false);

Thereafter the code uses jOOQ to do stuff, but the code gets a DSLContext by:

DSL.using(connection)

So my question was just to make sure I understood things. If the code instead used DSL.using(jooqConfiguration), then it would break the entire transaction, because jOOQ would request a new connection which wouldn't be the one we're working on above.



    (I am beginning to think that the answer is, "this won't work,
    because jOOQ will indeed request a new connection for each command.


No. jOOQ will request ANY Connection for each command. jOOQ doesn't care how YOU produce that Connection. That's your business.

But I don't produce the connection. The ConnectionProvider produces the connection, right? And in my example earlier, I indicated "I simply have a jOOQ Configuration wrapping a data source (with no Spring and no pooling and no anything else)", in which case jOOQ uses a DataSourceConnectionProvider, correct? So jOOQ will request a connection for each command, and that will wind up being a new connection from the data source. That's how I understand it anyway.

Thanks, Lukas. I'll be less lazy and step through all this stuff eventually.

Garret

--
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