Missing Configuration constructor in DefaultCloseableDSLContext

34 views
Skip to first unread message

Johannes Bühler

unread,
Nov 28, 2020, 7:15:42 AM11/28/20
to jOOQ User Group
In 3.14.x the DefaultCloseableDSLContext has been introduced and the DefaultDSLContext is not autocloseable anymore. We are using the Autoclosable capabilties within our tests to ensure a clean shutdown. In the previous JOOQ version 3.13.x we used the DSL.using(Configuration) api. Is there an Autoclosable equivalent in 3.14.x or is it planned to add a new constructor DefaultCloseableDSLContext(Configuration)? 

I am happy to create an Issue for that and provide a PR if that's the way to go.      

Thanks.

Lukas Eder

unread,
Nov 30, 2020, 3:45:16 AM11/30/20
to jOOQ User Group
Hi Johannes,

Can you please show what you're doing (in code) and why you're expecting the things you're expecting? 

Thanks,
Lukas

--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/38464b74-de2e-4f96-a9c3-56d39f5caff1n%40googlegroups.com.

Johannes Bühler

unread,
Nov 30, 2020, 6:45:07 PM11/30/20
to jooq...@googlegroups.com
Hi Lukas,
I created a simplified example similar to what we have in our codebase. You can find the working example here. It basically narrows down to the usage of the spock.lang.@AutoCleanup usage as you can see in BaseDBTest.groovy Let me know if you need more details. 

Thanks
Johannes







--

Johannes Bühler
Senior Software Engineer
Gradle
W. gradle.com


Lukas Eder

unread,
Dec 1, 2020, 4:11:02 AM12/1/20
to jOOQ User Group
Hi Johannes,

But why do you need to clean it up? The whole point of this (incompatible) change is that people called close() on non-resourceful DSLContext instances all the time, like you're doing right now. Your cleanup call does not have any effect.

Maybe, the issue description of the change helps explain this?

Thanks,
Lukas

Johannes Bühler

unread,
Dec 1, 2020, 6:52:01 AM12/1/20
to jooq...@googlegroups.com
Hi Lukas, 
got it - I adjusted it on our side. 
Thanks for making that (breaking) change for the better. 👍  

Johannes

Reply all
Reply to author
Forward
0 new messages