Contents Index Connecting to a database Checking the connection state

ASA Programming Guide
  Developing Applications with the .NET Data Provider
    Connecting to a database

Connection pooling


The Adaptive Server Anywhere .NET provider supports connection pooling. Connection pooling allows your application to reuse existing connections from a pool by saving the connection handle to a pool so it can be reused, rather than repeatedly creating a new connection to the database. Connection pooling is turned on by default.

The pool size is set in your connection string using the POOLING option. You can also specify the minimum and maximum pool sizes. For example,

"Data Source=ASA 9.0 Sample;UID=DBA;PWD=SQL;POOLING=TRUE;Max Pool Size=50;Min Pool Size=5"

When your application first attempts to connect to the database, it checks the pool for an existing connection that uses the same connection parameters you have specified. If a matching connection is found, that connection is used. Otherwise, a new connection is used. When you disconnect, the connection is returned to the pool so that it can be reused.

For more information about connection pooling, see ConnectionString property.


Contents Index Connecting to a database Checking the connection state