I want to implement connection pooling in my web application.please suugest how can i implement that.
Upvotes: 0
Views: 1557
Reputation: 175
While i do not have a definitive answer (and am also looking it), i can suggest the following (for a perl backend):
Upvotes: 0
Reputation: 63538
I'd say that you have two problems:
and
I'd initially work on the assumption that you DON'T need it, reusing connections is a (possibly premature) optimisation.
However, if you find that you really do need it, then how you do it will depend on the nature of your application-server.
Compelling reasons for using a new connection each time are:
The only compelling reason for reusing connections is the connection overhead time itself.
Some databases are relatively slow creating connections (Oracle) - others are much faster (MySQL). Some databases can be tuned to keep a pool of threads internally which they reuse (MySQL) which makes connecting even faster.
Upvotes: 2