3.3. Connection Pooling

Connection pooling refers to the practice of keeping a set of open database connections to be shared by sessions that use the same user ID in the database, thereby avoiding the need to constantly open and close the connection. Connection pooling is especially useful in a three-tier scenario, such as a Web server or forms server environment. It takes a nontrivial amount of time for each user (or middle-tier component) to connect to a database—sometimes longer than it takes to perform the query after the user is connected. In addition, each open connection takes up buffers and resources in the database. In a Web server scenario, users may never actually sign off of your application, so even if you had unlimited resources ...

Get Essential ADO.NET 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.