Export (0) Print
Expand All

OdbcConnection.ReleaseObjectPool Method

Indicates that the ODBC Driver Manager environment handle can be released when the last underlying connection is released.

Namespace: System.Data.Odbc
Assembly: System.Data (in system.data.dll)

'Declaration
Public Shared Sub ReleaseObjectPool
'Usage

OdbcConnection.ReleaseObjectPool
public static void ReleaseObjectPool ()
public static function ReleaseObjectPool ()

ReleaseObjectPool can be called to release the ODBC environment handle. You might want to call this method if, for example, the connection object will not be used again. When all connections in the environment are closed, the environment can be disposed. Note that calling the method alone does not actually release the active connections that exist in the environment.

The following must occur before the environment is finally disposed:

  1. Call Close to release the OdbcConnection object from the environment.

  2. Allow each connection object to time out.

  3. Call ReleaseObjectPool.

  4. Invoke garbage collection.

Conversely, if you call Close on all active connections, and invoke garbage collection, but do not call ReleaseObjectPool, the resources reserved for the environment remain available.

After an environment handle is released, a request for a new OdbcConnection creates a new environment.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1

Community Additions

ADD
Show:
© 2015 Microsoft