more useful options | |
PerlMonks |
Re^2: Best practices for closing database connections?by Polyglot (Chaplain) |
on Mar 17, 2022 at 11:28 UTC ( [id://11142169]=note: print w/replies, xml ) | Need Help?? |
Thank you for the tips and those links. Those are helpful. The problem I have with understanding or using placeholders, as mentioned in the first link, is that my queries are all different. For example, I query the user's privileges, usage statistics, preferences, the language parameters for the browser interface, the content for various divs on the page, etc., in addition to setting certain parameters in the database such as updating the user's last login/connection time. Much of this is repeated with each subsequent AJAX-driven request from the client's browser, but each time it is a new and separate calling of the script. There's hardly a single query that would be consistently run multiple times within a single execution of the script, so I am baffled as to the benefits of placeholders in such a case. In fact, seeing as each of these queries originates in a separate subroutine of the script, it will be challenging enough for me to open one global connection for all such queries and then close it before the script exits, rather than opening the connection for each query as I have done to date. Blessings, ~Polyglot~
In Section
Seekers of Perl Wisdom
|
|