Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Application Server

aaDBTransaction object

  • Last UpdatedJul 22, 2024
  • 1 minute read

This section explains how to use the aaDBTransaction object and the methods and properties associated with it.

Use objects of type aaDBTransaction to process multiple aaDBCommand objects as a single unit.

Create instances of type aaDBTransaction by calling the CreateTransaction() method on an instance of the aaDBConnection object. For example, assuming that the aaDBConnection instance is called Connection:

Connection.CreateTransaction()

If you want to ensure that all SQL commands are run as a whole or not run at all, you must create an instance of the aaDBTransaction object. Use the instance to create aaDBCommand objects.

When the transaction object is run, all aaDBCommand objects that are added to this aaDBTransaction object are run in the order that they were added. If the transaction is rolled back, none of the objects are run.

Commands added to a transaction cannot be run as stand-alone command objects but are automatically processed when the transaction runs.

When a script requests the transaction object ID, the transaction object is flagged to be persisted. The SQLData Script Library persists the object across scripts and scan cycles.

You can retrieve an aaDBTransaction object at any time by calling the static method aaDBAccess.GetTransaction () and passing the previously acquired string ID.

Note: You must call Dispose() on each instance of aaDBTransaction.

TitleResults for “How to create a CRG?”Also Available in