Connection pooling

The Adaptive Server Enterprise ADO.NET provider supports connection pooling, which allows your application to reuse existing connections from a pool. To do so, it saves 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.

You can also specify the minimum and maximum pool sizes. For example:

"Data Source='mango';" +
   "Port=5000;" +
   "UID='sa';" +
   "PWD='';" +
   "Database='pubs2';" +
   "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.

NoteIf Max Pool Size is specified, Data Provider restricts the maximum number of open connections to this value. The calls to AseConnection.Open() fail with AseException when this limit is reached.

Disabling connection pooling

To disable connection pooling, specify Pooling=False in the connection string.