Class AdbConnectionBuilder
An Adb connection builder that creates one AdbConnection
instance, as well as AdbCommandBuilder instances referencing the
connection builder and the AdbConnection it creates.
The Adb connection builder instance is created via factory methods on AdbProvider and AdbConnectionString.
Each connection builder instance has a database provider and connection string, which cannot be changed after it's created. It can in turn create a single AdbConnection database connection, for use with a single worker.
This class opens and closes connections in the same way as the underlying .NET DbConnection, and is
the normal type of connection to use for database access. AdbKeepOpenConnection is available
for the (rare) cases when a connection should stay open across multiple workers.
Implements
Inherited Members
Namespace: actionETL.Adb
Assembly: actionETL.dll
Syntax
public sealed class AdbConnectionBuilder : AdbConnectionBuilderBase, IAdbConnectionBuilder
Remarks
Do design database workers to take AdbConnectionString,
IAdbConnectionBuilder, and AdbCommandBuilder instances as parameters, which allows
them to support connections with different AdbConnectionMode. Conversely,
avoid passing AdbConnection, AdbKeepOpenConnection, AdbCommand,
or connection (text) strings to workers.
Examples
AdbConnectionBuilder Example demonstrates how to use this class.
Methods
Create()
Creates an Adb database connection, using the connection details of the
AdbConnectionBuilder instance.
Note: The AdbConnection instance is not thread-safe, and must only be used
in a single place (in a single worker) at any one time.
The connection can be opened and closed multiple times as needed, and it must
be disposed after use. Disposal should almost always be done by whoever created the
connection, typically via
DisposeOnFinished<TDisposable>(TDisposable)
or UsingActionWorker<TDisposable> if used across multiple method calls,
or by a using statement if created and disposed in a single method and thread, without
being passed to any other workers.
See Disposing Disposables for details.
Declaration
public override IAdbConnection Create()
Returns
| Type | Description |
|---|---|
| IAdbConnection | The Adb connection. |
Overrides
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Bad ConnectionString format. |
| Exception | See the provider documentation for which specific exceptions Open() can throw, it typically includes DbException and InvalidOperationException. |
| InvalidOperationException | Each AdbConnectionBuilder instance can only create a single AdbConnection instance. |