C# Класс Azavea.Open.DAO.SQL.DbConnectionCache

Holds connections, using the connection descriptor to determine what request wants what connection.
Показать файл Открыть проект

Открытые методы

Метод Описание
Get ( AbstractSqlConnectionDescriptor connDesc ) : IDbConnection

This returns a connection from the cache, or creates a new one if necessary. This method is thread safe. This method improved one test's performance (the only one I measured) by about 20%. Since some databases cannot have more than one connection at a time, we ask the connection descriptor whether we can actually cache the connection or not.

Return ( AbstractSqlConnectionDescriptor connDesc, IDbConnection conn ) : void

Inserts the connection into the cache IF we don't have one already (we only cache one connection per unique descriptor). This method is thread safe. Due to MS Access not allowing more than one connection to have the DB locked for modifying at one time, any connections to Access DBs are closed and not cached.

Описание методов

Get() публичный Метод

This returns a connection from the cache, or creates a new one if necessary. This method is thread safe. This method improved one test's performance (the only one I measured) by about 20%. Since some databases cannot have more than one connection at a time, we ask the connection descriptor whether we can actually cache the connection or not.
public Get ( AbstractSqlConnectionDescriptor connDesc ) : IDbConnection
connDesc AbstractSqlConnectionDescriptor
Результат IDbConnection

Return() публичный Метод

Inserts the connection into the cache IF we don't have one already (we only cache one connection per unique descriptor). This method is thread safe. Due to MS Access not allowing more than one connection to have the DB locked for modifying at one time, any connections to Access DBs are closed and not cached.
public Return ( AbstractSqlConnectionDescriptor connDesc, IDbConnection conn ) : void
connDesc AbstractSqlConnectionDescriptor
conn IDbConnection
Результат void