Hi there,
I was trying to find an answer to my question here, but still I am not
sure if my case matches with what I have found.

My question relates to the transaction management from recent thread.
The DSLContext instance is created with DataSource. I am not 100% sure
if the DSLContext (called "jooq" in my code) can be used
simultaneously by many threads.

The code is here:
https://github.com/witoldsz/ultm/blob/master/src/test/java/ultm/core/ULTMTest.java

I was not sure, so I have created a method jooq() which returns new
instance on each call in that test. When I remove that method and
replace it with one instance, created at boot time, the tests still
pass, but I am not sure if they do just by accident. If I am reading
correctly, the documentation says the DSLContext is as thread safe as
Configuration instance is, but I am not sure if my configuration is,
because it is created under the hood by jOOQ itself.


The question is, does the "many_threads_scenario" test would work 100%
fine with one jooq shared instance? Are there any constraints?

If the answer is yes, I could create one jooq instance in the
application I use that library with jOOQ for and bind it to
"singleton" context. Otherwise, I would have to inject the DSLContext
provider everywhere, or make a proxy which would pick the right
instance on each use.

Thanks,
Witold Szczerba

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