Writing a begin marker to the transaction file

begin_mark

Write a begin marker to the transaction file


SYNTAX

begin_mark

The begin_mark command is used to mark the start of a set of file updates that are to be treated as a single entity, or transaction, for the purposes of transaction logging. It writes a ‘begin transaction’ marker to the transaction log file and allocates an internal transaction number. All subsequent Sculptor file updates by the program are recorded as part of the transaction until the commit_mark command is executed, indicating that the transaction is complete, or the rollback_mark command is executed, reversing updates and cancelling the transaction.

This command, previously called begin, was replaced in Sculptor V. 5.1.0 by the begin() function, and renamed begin_mark for upward compatibility. Similarly, the commit and rollback commands have been replaced by functions and renamed commit_mark and rollback_mark. All three commands should be regarded as obsolescent. The functions are almost identical to the commands but do have some improvements in functionality. The begin() function locks every record that is part of a transaction until the transaction is committed or cancelled; with begin_mark, only a record currently read in update mode is locked.

Programs compiled with scc V. 5.0 or earlier map begin, commit and rollback to begin_mark, commit_mark and rollback_mark and work as before.

In order to recompile programs with scc V. 5.1, either append _mark to the commands, in which case they will work as they did before, or append “()” to convert the commands and use the new functionality.

See begin() for further details of transaction logging and the recovery program.


EXAMPLE

begin_mark
UpdateFiles()
commit_mark

RELATED TOPICS

sys.Logging

begin()

commit()

rollback()