Enterprise Library Data Access Application Block  7.0-rc1
The Data Access Application Block abstracts the actual database you are using, and exposes a collection of methods that make it easy to access that database and to perform common tasks.
Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeConnectionPool Class Reference

This class provides a primitive connection pool for SqlCeDatabase. More...

Static Public Member Functions

static void CloseSharedConnection (Database database)
 Closes the "keep alive" connection that is used by all databases with the same connection string as the one you provide. More...
 
static void CloseSharedConnections ()
 Closes all "keep alive" connections for all database instanced. More...
 
static DatabaseConnectionWrapper CreateConnection (SqlCeDatabase db, bool usePooledConnection)
 Creates a new connection. If this is the first connection, it also creates an extra "Keep Alive" connection to keep the database open. If usePooledConnection is true, than if this connection has been opened before, the connection from the pool will be returned rather than creating a new one. More...
 
static DatabaseConnectionWrapper CreateConnection (SqlCeDatabase db)
 Creates a new connection. If this is the first connection, it also creates an extra "Keep Alive" connection to keep the database open. Always returns a new SqlCeConnection object, not a pooled one. More...
 

Static Protected Attributes

static Dictionary< string, DatabaseConnectionWrapperconnections = new Dictionary<string, DatabaseConnectionWrapper>()
 Keeps a list of "keep alive" connections. More...
 

Detailed Description

This class provides a primitive connection pool for SqlCeDatabase.

Member Function Documentation

◆ CloseSharedConnection()

static void Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeConnectionPool.CloseSharedConnection ( Database  database)
static

Closes the "keep alive" connection that is used by all databases with the same connection string as the one you provide.

Parameters
databaseThe database with the connection string that defines which connections should be closed.

◆ CloseSharedConnections()

static void Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeConnectionPool.CloseSharedConnections ( )
static

Closes all "keep alive" connections for all database instanced.

◆ CreateConnection() [1/2]

static DatabaseConnectionWrapper Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeConnectionPool.CreateConnection ( SqlCeDatabase  db)
static

Creates a new connection. If this is the first connection, it also creates an extra "Keep Alive" connection to keep the database open. Always returns a new SqlCeConnection object, not a pooled one.

Parameters
dbThe database instance that will be used to create a connection.
Returns
A new connection.

◆ CreateConnection() [2/2]

static DatabaseConnectionWrapper Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeConnectionPool.CreateConnection ( SqlCeDatabase  db,
bool  usePooledConnection 
)
static

Creates a new connection. If this is the first connection, it also creates an extra "Keep Alive" connection to keep the database open. If usePooledConnection is true, than if this connection has been opened before, the connection from the pool will be returned rather than creating a new one.

Parameters
dbThe database instance that will be used to create a connection.
usePooledConnectionIf true, return an already created connection for this object. If false, always create a new one.
Returns
A new connection.

Member Data Documentation

◆ connections

Dictionary<string, DatabaseConnectionWrapper> Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.SqlCeConnectionPool.connections = new Dictionary<string, DatabaseConnectionWrapper>()
staticprotected

Keeps a list of "keep alive" connections.


The documentation for this class was generated from the following file: