Slava Golovachenko wrote:I set up the DB connection in a context listener and save Connection object as a context attribute for the servlets to access (is that right?).
Not a good approach. This holds a connection open -- an expensive resource -- for the entire lifetime of the web application, and you are going to run into contention and synchronization issues.
You'd be much better off using a connection pool. Are you using
Tomcat? It comes with any easy-to-use container-managed connection pool built right in.