Class AdbExecuteNonQueryTarget<TInputError>
A dataflow worker with one Input port, that uses ExecuteNonQuery()
to execute an SQL query for each incoming row.
It also has an ErrorOutput port that receives any rows that throw an exception
when creating and executing their queries.
Note: Use the factory methods in AdbExecuteNonQueryTargetFactory to create instances of this class.
It uses CreateSetParametersFromRowAction<T>(AdbParameterCollection) to set parameter values from incoming rows. The worker does not give access to the query return value or any output parameters.
Also see SQL Database Access.
Note: This worker does participate in any transaction currently active on the connection.
Implements
Inherited Members
Namespace: actionETL.Adb
Assembly: actionETL.dll
Syntax
public class AdbExecuteNonQueryTarget<TInputError> : WorkerBase<AdbExecuteNonQueryTarget<TInputError>>, IDisposeOnFinished where TInputError : class
Type Parameters
| Name | Description |
|---|---|
| TInputError | The type of each |
Properties
CommandBuilder
Gets or sets the builder for the database command. Can only be set before the worker starts running.
Note: This property is thread-safe.
Declaration
public AdbCommandBuilder CommandBuilder { get; set; }
Property Value
| Type | Description |
|---|---|
| AdbCommandBuilder |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Cannot set the property after the worker has started running. |
ErrorOutput
Gets the error output port for sending error rows to logging and an optional downstream worker.
Declaration
public ErrorOutputPort<TInputError> ErrorOutput { get; }
Property Value
| Type | Description |
|---|---|
| ErrorOutputPort<TInputError> | The error output port. |
Input
Gets the input port for receiving rows from an upstream worker.
Declaration
public InputPort<TInputError> Input { get; }
Property Value
| Type | Description |
|---|---|
| InputPort<TInputError> |
TransactionMaxBatches
Gets or sets the maximum number of commands to group into an internal transaction. Can only be set before the worker starts running. Grouping short-running commands into a transaction improves performance. Only used if no command transaction has been set.
Set to greater than 0 to get that number of maximum commands per transaction.
Set to -1 to disable internal transaction grouping.
Leave it at the default 0 to get the default number of maximum commands per transaction
(usually 10).
Note: This property is thread-safe.
Declaration
public int TransactionMaxBatches { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 | The maximum number of internal transaction commands. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Cannot set the property after the worker has started running. |
Methods
RunAsync()
This method can be overridden to add custom functionality to the derived worker that runs before
and after the row processing. In this case, the base class base.RunAsync() must
be called for the worker to function correctly.
Typically, this worker is used without overriding this method.
Declaration
protected override async Task<OutcomeStatus> RunAsync()
Returns
| Type | Description |
|---|---|
| Task<OutcomeStatus> | A |