The Database collection agent performs some extra maneuvers to ensure that data is not recollected or lost if the workflow aborts before the collection of a batch has finished correctly.
A unique Transaction ID is retrieved for each new batch.
The pending transaction table is queried for all pending Transaction IDs, to be compared with the transaction IDs in the working table, from which the agent will collect.
The SQL query is built and executed, and all matching rows are collected. In addition to the user defined condition, the agent adds some conditions to the query, to ensure that pending data, cancelled data and data marked as collected is not collected.
For each row that has been successfully converted to a UDR, the agent updates its Transaction ID column to the Transaction ID retrieved in bullet 1.
When all rows matching the query have been successfully collected, the After Collection configuration in the Source tab, is used.
If Remove, all rows with the given Transaction ID are removed in batches of the size configured as the Commit Window Size, in the Advanced tab.
If Mark as Collected, all rows with the given Transaction ID are updated with the reserved Transaction ID value
-1
.If Run SP, the user defined stored procedure is executed. For further information, see After Collection Stored Procedure in Tables and Stored Procedures[hide]3.0[/hide].
Emits
The agent emits commands that changes the state of the file currently processed.
Command | Description |
---|---|
Begin Batch | Emitted after the SQL |
End Batch | Emitted after the SQL |
Note!
If the SQL select
statement does not return any data, Begin and End Batch will not be emitted. Not even if Produce Empty Files is selected in a Forwarding Disk agent.
Retrieves
The agent retrieves commands from other agents and based on them generates a state change of the file currently processed.
Command | Description |
---|---|
Cancel Batch | All rows with the current Transaction ID are updated with the reserved Transaction ID The database row that issued the Cancel Batch request is written to the System Log. Note! If the Cancel Batch behavior defined on workflow level is configured to abort the workflow, the agent will never receive the last Cancel Batch message. In this situation the rows will not be updated with the reserved Transaction ID |
Hint End Batch | An End Batch call will be issued, causing the original batch returned by the SQL query to be split at the current UDR. The database |
0 Comments