C# 클래스 Azavea.Open.DAO.SQL.DbConnectionCache

Holds connections, using the connection descriptor to determine what request wants what connection.
파일 보기 프로젝트 열기: azavea/net-dao

공개 메소드들

메소드 설명
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