When using Hibernate ORM with virtual threads, writes are pinning the carrier thread because of the synchronization happening in PooledLoOptimizer. This happens because some I/O are performed while holding this monitor lock. We could remove the “synchronized” method to work around that limitation and use a Java lock instead. Java locks are virtual thread friendly. They do not pin the carrier thread when an I/O is executed when holding the lock. |