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.
|
This is a small helper class used to manage closing a connection in the presence of transaction pooling. We can't actually close the connection until everyone using it is done, thus, we need reference counting. More...
Public Member Functions | |
DatabaseConnectionWrapper (DbConnection connection) | |
Create a new DatabaseConnectionWrapper that wraps the given connection . More... | |
void | Dispose () |
Decrement the reference count and, if refcount is 0, close the underlying connection. More... | |
DatabaseConnectionWrapper | AddRef () |
Increment the reference count for the wrapped connection. More... | |
Protected Member Functions | |
virtual void | Dispose (bool disposing) |
Usual Dispose pattern folderal to shut up FxCop. More... | |
Properties | |
DbConnection | Connection [get] |
The underlying DbConnection we're managing. More... | |
bool | IsDisposed [get] |
Has this wrapper disposed the underlying connection? More... | |
This is a small helper class used to manage closing a connection in the presence of transaction pooling. We can't actually close the connection until everyone using it is done, thus, we need reference counting.
User code should not use this class directly - it's used internally by the authors of DAAB providers to manage connections when using the DAAB methods.
Microsoft.Practices.EnterpriseLibrary.Data.DatabaseConnectionWrapper.DatabaseConnectionWrapper | ( | DbConnection | connection | ) |
Create a new DatabaseConnectionWrapper that wraps the given connection .
connection | Database connection to manage the lifetime of. |
DatabaseConnectionWrapper Microsoft.Practices.EnterpriseLibrary.Data.DatabaseConnectionWrapper.AddRef | ( | ) |
Increment the reference count for the wrapped connection.
void Microsoft.Practices.EnterpriseLibrary.Data.DatabaseConnectionWrapper.Dispose | ( | ) |
Decrement the reference count and, if refcount is 0, close the underlying connection.
<filterpriority>2</filterpriority>
|
protectedvirtual |
Usual Dispose pattern folderal to shut up FxCop.
disposing | true if called via DatabaseConnectionWrapper.Dispose() method, false if called from finalizer. Of course, since we have no finalizer this will never be false. |
|
get |
The underlying DbConnection we're managing.
|
get |
Has this wrapper disposed the underlying connection?