Procedure StartTransaction(IsolationLevel)

StartTransaction

By default, AIMMS places a transaction around any single WRITE statement to a database table. In this way, AIMMS makes sure that the complete WRITE statement can be rolled back in the event of a database error during the execution of that WRITE statement. With the procedure StartTransaction you can manually initiate a database transaction which can contain multiple READ, WRITE statements and SQL queries.

StartTransaction(
     IsolationLevel         ! (optional) an element expression
     )

Arguments

IsolationLevel

Element value into the set AllIsolationLevels, indicating the isolation level at which the transaction has to take place. If omitted, defaults to 'ReadCommitted'.

Return Value

The procedure returns 1 if the transaction was started successfully, or 0 otherwise.

Note

You cannot call StartTransaction recursively, i.e. you must call CommitTransaction or RollbackTransaction prior to the next call to StartTransaction.

See also

The procedures CommitTransaction and RollbackTransaction.