ADO.NET Provider for Quandl

Build 20.0.7587

Connection Pooling

The provider implements a standard ADO.NET connection pool. Set UseConnectionPooling to enable the pool. The following sections show how to configure and use them.

Working with Pooled Connections

Just as you would interact with a non-pooled connection, you use standard ADO.NET objects to get and close connections. But, in this case, the QuandlConnection object retrieved is a handle for the physical connection owned by the connection pool. When the connection is closed, instead of the connection being destroyed, the handle is returned to the pool, where it is available for the next connection request.

You must explicitly close the connection for it to be returned to the pool.

Creating Pooled Connections

The connection pools are based on the unique connection strings except for the Pool properties and any persisted temporary values. The following example instantiates three connections using two distinct connection pools. Two of the connections share the same connection pool, as they share the same connection string.

C#

using (QuandlConnection connection = new QuandlConnection("ApiKey=abc123;DatabaseCode=WIKI;")) {connection.Open();}

using (QuandlConnection connection = new QuandlConnection("PoolIdleTimeout=-1;ApiKey=abc123;DatabaseCode=WIKI;")) {connection.Open();}

using (QuandlConnection connection = new QuandlConnection("Timeout=15;ApiKey=abc123;DatabaseCode=WIKI;")) {connection.Open();} //spawns a new pool
VB.NET
Using (QuandlConnection connection = new QuandlConnection("ApiKey=abc123;DatabaseCode=WIKI;")) 
  connection.Open()
End Using

Using (QuandlConnection connection = new QuandlConnection("PoolIdleTimeout=-1;ApiKey=abc123;DatabaseCode=WIKI;")) //same connection pool
  connection.Open()
End Using

Using (QuandlConnection connection = new QuandlConnection("Timeout=15;ApiKey=abc123;DatabaseCode=WIKI;")) //spawns a new connection pool
  connection.Open()
End Using

Closing the Connection Pool

The connection pool is closed when the active process ends.

Copyright (c) 2020 CData Software, Inc. - All rights reserved.
Build 20.0.7587