Compiler File Options

There are three compiler options that can simplify the addition of transaction management facilities to existing programs that use the Vision file system. The -Ft option causes implied transactions for every OPEN, CLOSE, WRITE, REWRITE, or DELETE operation that is not part of an explicit transaction. In other words, single file operations that are not part of a transaction are preceded by an implied START TRANSACTION and followed by an implied COMMIT. This makes it easier to convert existing applications to a transaction system.

The -Fs option causes an implied START TRANSACTION verb before the first OPEN, CLOSE, WRITE, REWRITE, or DELETE operation and after each COMMIT or ROLLBACK. This, in effect, makes every file operation part of a transaction. If this option is enabled, and the compiler encounters a START TRANSACTION verb, it reports a warning and does not generate any code for the START TRANSACTION. The -Fs option provides an alternate way to program transactions and is often useful when you are converting from other COBOL or SQL implementations.

A third compiler file option, -Fl, enables single locking rules rather than multiple locking rules as the lock mode default. Normally, WITH ROLLBACK causes multiple locking rules to be in effect for a file. When -Fl is used, the WITH ROLLBACK clause does not affect whether single or multiple record locking rules are followed. Single locking becomes the default. You may enable multiple locking either by specifying WITH LOCK ON MULTIPLE RECORDS in a file's SELECT statement or by using APPLY LOCK-HOLDING ON file in the I-O CONTROL paragraph.