Hello All,
I was having a debate with a colleague today re: best practice when it comes to handling connections to online databases.
Imagine a situation like this:
My colleague argues that it would be better to initiate a new connection object to make the new query; I argue that one should close the current connection object, wait for it to close and then re-connect using the same connection object to perform the new query.
Which do you prefer?
Jord
I was having a debate with a colleague today re: best practice when it comes to handling connections to online databases.
Imagine a situation like this:
- We connect to the database using one connection object
- We make a query
- As a result of that query, we need to make another
My colleague argues that it would be better to initiate a new connection object to make the new query; I argue that one should close the current connection object, wait for it to close and then re-connect using the same connection object to perform the new query.
Which do you prefer?
Jord