ExecuteAsync()
- Last UpdatedNov 25, 2015
- 1 minute read
Use the ExecuteAsync() method to instruct the SQLData Script Library to queue all command objects in the transaction that are queued for later processing. ExecuteAsync() returns immediately and processing occurs in the background.
Syntax
Result ExecuteAsync()
Remarks
You can use the ExecutionState property to check for status.
If any commands complete with an error, the SQLData Script Library issues a transaction rollback to prevent changes to the data source.
After ExecuteAsync() is processed, you can still obtain a reference to any commands that were added and analyze their ExecutionState and LastExecutionError properties.
When the transaction object runs, all aaDBCommand objects that are added to the aaDBTransaction are run in the order that they were added. The following outcomes can occur as the result of processing a transaction:
-
Success: All commands succeeded. Each command shows an ExecutionState of Completed. Any dataset for that command is associated with it.
-
Cancellation: Each command in the transaction shows an ExecutionState of Canceled. Any data associated with the command is removed.
-
Failure: When one command in a transaction fails, the command has an ExecutionState of Failed. All commands preceding it show an ExecutionState of Completed and retain any datasets that were part of their successful processing.
To free all resources allocated for the transaction object and the commands, you must call Dispose().