Hi all !
I have this application which has an Applet to communicate with servlets to access database information. The servlets are separated by "subjects". For example, to access the inventory, the applet calls SSInventory (servlet) or to access People information, the applet uses SSPeople.
In the previous version of the application, each servlet had as a static variable a DBConnection instance. That instance was created in the init() method of the servlet. This means that once a servlet is initialized, it has a DBConnection instance, even though the servlet remains not used for days. In this case, we had 13 servlets, so 13 "pending" connections.
In the new version, I was hoping to improve this little fact. I was thinking of a connection pool, which would be kept in some service servlet. This connection pool would create new connections as needed or used unused connections. The thing is that our application can be used by a company with about 50 employees or with 10 000 employees.
So how do I manage this connection pool ? Is it a good idea ? What is the best way to manage connections to the database ?
Thanks you all !
Max.
