VistaDB 6
VistaDB.Provider Namespace / VistaDBConnection Class / ClearPool Method
A VistaDBConnection instance (typically while in a closed state) whose corresponding connection pool is to be cleared.
Example


In This Topic
    ClearPool Method
    In This Topic
    Clear a specific connection pool associated with the specified connection instance.
    Syntax
    'Declaration
     
    
    Public Shared Sub ClearPool( _
       ByVal connection As VistaDBConnection _
    ) 
    'Usage
     
    
    Dim connection As VistaDBConnection
     
    VistaDBConnection.ClearPool(connection)
    public static void ClearPool( 
       VistaDBConnection connection
    )

    Parameters

    connection
    A VistaDBConnection instance (typically while in a closed state) whose corresponding connection pool is to be cleared.
    Remarks

    This will clear the pool of inactive connections (which are awaiting possible reuse) for a specific database and open mode without affecting pools for other databases or other open modes of the same database.

    Note that this does not close currently "open" connections that have not been returned to the pool for reuse. Also note that pooling is managed by each embedded VistaDB engine (each process) and is not shared between processes, so it also does not close connections that could exist for the same database in other processes.

    Example
    using (VistaDBConnection conn = new VistaDBConnection(
            @"Open Mode=MultiProcessReadWrite;Pooling=true;Data Source=" + dbname) ) 
    { 
        Assert.IsNotNull(conn); 
        conn.Open(); 
        Assert.IsTrue(conn.State == ConnectionState.Open); 
        conn.Close(); 
        VistaDBConnection.ClearPool(conn); 
    }
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also