Question about using virtual thread

Attila Kelemen attila.kelemen85 at gmail.com
Mon Jun 19 08:45:08 UTC 2023


>
>
> I don't know anything about DBCP2 but I'm curious to know if you really
> need to use a Semaphore with DataSource.getConnection. If it doing JDBC
> connection pooling then I would expect it would block, waiting for
> someone else to close a Connection and return it to the pool.
>
>
You don't need it. For the semaphore case I'm not using a connection pool.
The reason I added it, because it is very simple, and I can reason about
its expected behaviour easier. Of course, in that case I'm not saving the
creation of a new connection, but I can still test thread pinning.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20230619/9e3553a7/attachment-0001.htm>


More information about the loom-dev mailing list