Custom Field Error on JOOQ 3.11.9

19 views
Skip to first unread message

bant...@gmail.com

unread,
May 15, 2019, 11:49:49 PM5/15/19
to jOOQ User Group
Hello,

I've created a custom field, binding, and converter for working with PostGIS geometry columns.  This code works well on JOOQ 3.10.x, but when updating to 3.11.x I'm running to errors.  I followed the example here.  In JOOQ 3.11, the first time the custom field is evaluated the delegate(Configuration configuration)gets called with the correct Postgres configuration for my DSLContext.  However, on subsequent calls a different default Configuration is passed in and my configuration.dialect().family() check fails.  Looking up through the stack shows that the DSLContext is being replaced with a DefaultDSLContext that loses the connection to the database.  Have I missed a migration when upgrading to 3.11?  Thanks in advance for the assistance.


Cheers,
Brett

Lukas Eder

unread,
May 16, 2019, 6:05:43 AM5/16/19
to jooq...@googlegroups.com
Hi Brett,

Thank you very much for your report.

From your description, it is difficult to assess what's going on here. Ideally, if you think there's a bug like this, it would be helpful to have an MCVE (Minimal, Complete, Verifiable Example) that helps understand 1) what you really did, 2) what kinds of stack traces you're referring to, where you're losing the connection to the database. Here's a template to build such an MCVE: https://github.com/jOOQ/jOOQ-mcve

As a side note, there's a much better feature you could use to to support vendor specific functionality, if you don't really need to support several databases dialects. This is plain SQL templating:

I hope this helps,
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/c23a4e9d-bf80-439a-aa57-fc00be5e9bb2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Lukas Eder

unread,
May 16, 2019, 6:09:05 AM5/16/19
to jOOQ User Group
We'll improve the manual to make it clear on the page you were navigating that a more simple approach exists for simple use cases:


On Thursday, May 16, 2019 at 12:05:43 PM UTC+2, Lukas Eder wrote:
Hi Brett,

Thank you very much for your report.

From your description, it is difficult to assess what's going on here. Ideally, if you think there's a bug like this, it would be helpful to have an MCVE (Minimal, Complete, Verifiable Example) that helps understand 1) what you really did, 2) what kinds of stack traces you're referring to, where you're losing the connection to the database. Here's a template to build such an MCVE: https://github.com/jOOQ/jOOQ-mcve

As a side note, there's a much better feature you could use to to support vendor specific functionality, if you don't really need to support several databases dialects. This is plain SQL templating:

I hope this helps,
Lukas

On Thu, May 16, 2019 at 5:49 AM <bant...@gmail.com> wrote:
Hello,

I've created a custom field, binding, and converter for working with PostGIS geometry columns.  This code works well on JOOQ 3.10.x, but when updating to 3.11.x I'm running to errors.  I followed the example here.  In JOOQ 3.11, the first time the custom field is evaluated the delegate(Configuration configuration)gets called with the correct Postgres configuration for my DSLContext.  However, on subsequent calls a different default Configuration is passed in and my configuration.dialect().family() check fails.  Looking up through the stack shows that the DSLContext is being replaced with a DefaultDSLContext that loses the connection to the database.  Have I missed a migration when upgrading to 3.11?  Thanks in advance for the assistance.


Cheers,
Brett

--
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+unsubscribe@googlegroups.com.

bant...@gmail.com

unread,
May 16, 2019, 9:44:45 AM5/16/19
to jOOQ User Group
Lukas,

Thanks for the speedy reply.  I realize it's difficult to verify the issue without a sample.  I'll work on putting one together, but in the meantime you confirmed that I didn't miss an obvious enhancement/deprecation in 3.11.x. For now, I've been able to revert to 3.10.8 until I can get you an MCVE.


On Thursday, May 16, 2019 at 6:09:05 AM UTC-4, Lukas Eder wrote:
We'll improve the manual to make it clear on the page you were navigating that a more simple approach exists for simple use cases:
https://github.com/jOOQ/jOOQ/issues/8639

On Thursday, May 16, 2019 at 12:05:43 PM UTC+2, Lukas Eder wrote:
Hi Brett,

Thank you very much for your report.

From your description, it is difficult to assess what's going on here. Ideally, if you think there's a bug like this, it would be helpful to have an MCVE (Minimal, Complete, Verifiable Example) that helps understand 1) what you really did, 2) what kinds of stack traces you're referring to, where you're losing the connection to the database. Here's a template to build such an MCVE: https://github.com/jOOQ/jOOQ-mcve

As a side note, there's a much better feature you could use to to support vendor specific functionality, if you don't really need to support several databases dialects. This is plain SQL templating:

I hope this helps,
Lukas

On Thu, May 16, 2019 at 5:49 AM <bant...@gmail.com> wrote:
Hello,

I've created a custom field, binding, and converter for working with PostGIS geometry columns.  This code works well on JOOQ 3.10.x, but when updating to 3.11.x I'm running to errors.  I followed the example here.  In JOOQ 3.11, the first time the custom field is evaluated the delegate(Configuration configuration)gets called with the correct Postgres configuration for my DSLContext.  However, on subsequent calls a different default Configuration is passed in and my configuration.dialect().family() check fails.  Looking up through the stack shows that the DSLContext is being replaced with a DefaultDSLContext that loses the connection to the database.  Have I missed a migration when upgrading to 3.11?  Thanks in advance for the assistance.


Cheers,
Brett

--
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...@googlegroups.com.

Lukas Eder

unread,
May 16, 2019, 10:40:58 AM5/16/19
to jooq...@googlegroups.com
 but in the meantime you confirmed that I didn't miss an obvious enhancement/deprecation in 3.11.x

Indeed, there's either something going on in your code, or this is a (subtle?) regression in jOOQ, nothing I'm aware of. 
Reply all
Reply to author
Forward
0 new messages