I have a parallel process that makes and closes many MySQL connections. Each process only makes one connection at any given time. Often times while mid-process (and a connection is not established) another external connection is made such that the process cannot connect because the maximum connections have been exceeded.
I want to know if there is a way to check-out or reserve connections for the duration of my process. The MySQL server I am accessing has a maximum allotted connections of 50, and my user can have 25, so I would like to "reserve" 25 connections.
Ideally, at the beginning of the process I would check for the number of connections available, and use either 25 (my user maximum) or the maximum available.