8.7. Connection management and pooling

8.7.1. The need for connection management

An enterprise application may employ many EJBs, each supported by many instances of the EJB implementation class. Between them these implementations may open and close connections to external resources very rapidly. This leads to two problems. First, opening and closing database connections is computationally expensive. It typically takes a second or two to establish a new connection to a commercial-grade database server, which gives an idea of the amount of work that’s going on behind the scenes. Second, there is often a limitation on the number of database connections that can be open simultaneously, since each consumes significant resources; there may also be ...

Get Applied Enterprise JavaBeans™ Technology now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.