Description:
Hi
There seems to be some kind of race condition between closing connections and statements.
I'm able to reliable trigger a NullPointerException in StatementImpl::getWarnings due to session being null (because the connection was closed by another thread).
I initially thought this was a problem related to interactions between the hikaricp connection pool and the jooq framework, but after reporting the bug on the jooq mailing list <https://groups.google.com/g/jooq-user/c/mvrKSt47h4Q> I was directed here.
How to repeat:
There is probably a simple way to trigger this, but I have created a small project on github that reproduces it by using testcontainers, hikaricp and jooq: https://github.com/djarnis73/jooq-hikari
If that is too much clutter, I can see if I can reproduce it without involving third party libraries.