Try OpenEdge Now
skip to main content
Developing WebSpeed Applications
Controlling Database Transactions : Transaction system mechanics : Subtransaction mechanics
 

Subtransaction mechanics

If a database transaction is already active and WebSpeed encounters a DO ON ERROR, DO TRANSACTION, FOR EACH, REPEAT, or procedure block, WebSpeed starts a subtransaction. All database activity occurring during that subtransaction is written to a local-before-image (LBI) file. WebSpeed maintains one LBI file for each WebSpeed agent. If an error occurs during the subtransaction, WebSpeed uses this local-before-image file to restore the database to the condition it was in before the subtransaction started. WebSpeed uses the local-before-image file to back out variables and to back out subtransactions in all cases when an entire database transaction is not being backed out.
Note that the first time a variable is altered within a subtransaction block, all of the variables in the procedure are written to the LBI file as a record.
Because the local-before-image information is not needed for crash recovery, it does not have to be written to disk in a carefully synchronized fashion as does the before-image information. This minimizes the overhead associated with subtransactions. The local-before-image file is written using normal, buffered I/O.
The amount of disk space required for each user's LBI file depends on the number of subtransactions started that are subject to being undone.