Hello,

Your approach is valid for your use-case. It doesn't really matter if you
create a new DSLContext for every query, or if you reuse it for the scope
of the transaction, or even of the whole DataSource. In our tutorial, we
reuse the a single DSLContext instance for all of the application, and
inject it using @Autowired:
http://www.jooq.org/doc/latest/manual/getting-started/tutorials/jooq-with-spring/

jOOQ is unaware of how Spring manages your transaction, so all the magic
really remains inside of that DataSource.

Hope this helps,
Lukas


2015-01-06 22:40 GMT+01:00 <[email protected]>:

> We have a serializable isolation leveled Spring transaction. Inside, it
> makes many queries (probably too many, but that is right now besides the
> point). For each query, we create a new DSLContext that we get by using
> DSL.using(new org.jooq.impl.DataSourceConnectionProvider(dataSource),
> DQLDialict.MYSQL, new Settings()).
>
> My question is if inside the transaction we are guaranteed that the same
> connection will be made for each query.
>
> Thanks,
>
> M
>
> --
> 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.
>

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