The answer is "it depends".
In most situations, database connections are a limited resource, just like disk space or bandwidth, etc. For example, if you had a maximum limit of 100 database connections, and many clients trying to connect at the same time, you would want each client to get its data then disconnect as soon as possible, in order to not block other clients. This would be like an ATM machine checking an account balance at a bank.
On the other hand, if you had a server connected to the database, and lots of clients making similar requests at the same time, it might be better for the server to establish a single, persistent connection to the database, and cache commonly accessed data to avoid redundant queries. This would be like a web site where users read book reviews, for example.
In reply to Re: Perl with Database connection.
by scorpio17
in thread Perl with Database connection.
by santhosh_89
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |