Renamed variables and reordered type info arrays in `DatabaseMetadataTest` to ensure consistency with database changes. Adjusted table and procedure names in `ProcedureParameterTest` to reflect proper usage and avoid conflicts. These changes improve clarity and maintain test accuracy.
Initializing multiple pools in parallel incurred significant lock
contention on `poolMap` because this lock was held while any `Pool` was
being constructed (which could take several seconds).
Because of this, connecting to independent databases in parallel was not
possible (Pool creation was serialized), severely limiting overall
performance.
*Changes*
* Add `PoolHolder` to defer creation of `Pool` and act as a lock for
each pool key.
* Insert a new `PoolHolder` while holding the `poolMap` lock, reducing
global thread contention.
* Threads looking up the same key will acquire the same `PoolHolder` and
that `PoolHolder` will ensure that only one `Pool` is created. Threads
looking up unrelated `PoolHolder` will not be blocked by `Pool`
creation.
* Make registerJxm/unRegisterJmx thread safe. When Pool creation
happened in parallel, there were errors in the logs because `Pool` was
attempted to be registered more than one.
*Testing*
This change should have no impact on functionality. Performance should
be improved when creating many Pools in parallel. Performance should
remain the same when creating `Pool` instances sequentially.
* Unit test added to validate that many pools can be created in parallel
without issue.
* Tested against ~20 real DB servers and saw performance improvement.
All connections were created at the same time on separate threads.