FinishSuperFileTransaction

STD.File.FinishSuperFileTransaction( [ rollback ] )

rollbackOptional. A boolean flag that indicates whether to commit (FALSE) or roll back (TRUE) the transaction. If omitted, the default is FALSE.
Return: Null.

The FinishSuperFileTransaction function terminates a superfile maintenance transaction frame.

If the rollback flag is FALSE, the transaction is committed atomically and the transaction frame closes. Otherwise, the transaction is rolled back and the transaction frame closes.

At commit, the superfile is “write” locked for the transaction to actually execute, and all locks are released when the transaction frame closes. During the timeframe of the “write” lock at commit (usually small time window), no concurrent “read” locks are allowed.

Example:

IMPORT STD;
 
WeeklyRollup:='~Training::Examples::WeeklyRollup';
WeeklySF    :='~Training::Examples::Weekly';
DailySF     :='~Training::Examples::Daily';
 
DailyDS := DATASET(DailySF,{string Myfield},THOR);
 
SEQUENTIAL(STD.File.StartSuperFileTransaction(),
           STD.File.ClearSuperFile(DailySF),
           OUTPUT(DailyDS,,WeeklyRollup),
           STD.File.AddSuperFile(WeeklySF,WeeklyRollup),
           STD.File.FinishSuperFileTransaction());
//executes the OUTPUT after a "read" lock on the superfile DailySF
//has been initiated by the ClearSuperFile Maintenance function, 
//which in turn executes only at the FinishTransaction