vendredi 6 février 2015

Design pattern: Object pool of connections

Recently I started researching more information about the object pool design pattern and I ran into questions that I couldn't found them an answer.


the idea of the object pool pattern is to save expensive resources by reusing them. for examle the connection to the db is a very expensive resource. Therefore i would like to add it to the "pool".


I have always been taught to keep the connection open as little as possible. I may get this all wrong, but in my point of view, creating a new connection and keeping it alive for a long period of time (in the pool) its just a waste of resources. The connection may not be created several times, but it will alway be open.


I would glad to have an explanation.


Aucun commentaire:

Enregistrer un commentaire