For any MySQL users:
The 9.0.0 connector-j is available now that rewrites all the synchronized stuff to use ReentrantLock so that the driver is compatible with virtual threads.
My reading of that (long) thread is that Hikari doesn't use synchronized on any critical path so it "doesn't matter". What is a real issue is vthread code overwhelming the connection pool and getting timeouts - which is already a problem with native thread code, but perhaps more likely with vthread code.
No one provided a repro case of pinning within Hikari...
Interesting. There are other discussions in the issues tab that talk about it. However, worth a shot I think! I'm happy for the connector change too! 🙂
Databases have a limit on concurrent connections so you can't have unlimited pool sizes anyway - so there has to be some throttling somewhere.
I think I'll have to wait until HikariCP supports virtual threads:
(we've already updated at work and we're starting to use vthreads -- finally! -- and we're not seeing any pinned o/s threads so... yay!)