Browser-Client Task Transactions (Magic xpa 4.x)
Magic xpa’s deferred transaction mechanism accumulates all the data manipulation statements in memory, and all modifications are sent to the database at the end of the record suffix or at the end of the task, depending on the transaction scope. Browser-Client tasks can only work in the deferred transaction mode. The transaction modes can be Deferred, Nested deferred or None.
The default transaction mode of a browser-client task is a deferred transaction beginning at the record level. This setting is the recommended setting for tasks that manipulate each record as a logic unit.
The available transaction modes for a browser tasks are explained below:
-
None – No transaction is opened for the task. Any transaction opened from this task will be an independent transaction.
-
Deferred – If the task is called from another task whose transaction is set to None, or if the task is called as the first running browser task, the task opens an independent transaction. If the task is opened from another task which has an opened transaction, the task transaction will be part of its parent transaction.
-
Nested deferred – The task always opens an independent transaction.
Another important definition to consider is the transaction resolution. The resolution of a transaction can either be of a record or of the entire task. The Begin transaction task property provides two options:
-
Before Record Prefix – The transaction, a record level transaction, will be opened before the Record Prefix of each record and ended after each record suffix.
-
Before Task Prefix – The transaction, a task level transaction, will be opened before the Task Prefix and ended after the task suffix.