A
Alberto Poblacion
If you only need the connection briefly to read a few data, then spend a lot
of time processing these data, and then need the connection briefly again,
then it is better to close the connection while it is not in use. In this
way you free the server to use the connection for other processes, and if
every program does this the total nuber of connections needed on the server
will be smaller than if every process keeps the connections open all the
time. Don't worry about the overhead of "reopening" the connection when you
need it again; the connection pool will automatically take care of
minimizing the actual opening and closing of connections.
of time processing these data, and then need the connection briefly again,
then it is better to close the connection while it is not in use. In this
way you free the server to use the connection for other processes, and if
every program does this the total nuber of connections needed on the server
will be smaller than if every process keeps the connections open all the
time. Don't worry about the overhead of "reopening" the connection when you
need it again; the connection pool will automatically take care of
minimizing the actual opening and closing of connections.