ContentsIndexPreviousNext

A4GL-COMMIT-COUNT

The value of A4GL-COMMIT-COUNT indicates the conditions under which you want to issue an automatic COMMIT4gl90004.gifWORK operation. Valid values are:

COMMIT-COUNT = 0 (Default)
When you set this variable to zero, the runtime tracks the number of logical locks that are currently in effect. When the number of logical locks reaches zero, the runtime assumes that a transaction is complete and issues a COMMIT statement.

COMMIT-COUNT = n
When you set this variable to a nonzero value, the runtime tracks the number of WRITE, REWRITE, and DELETE operations, until the value of COMMIT-COUNT is reached, at which time the runtime issues a COMMIT statement. The READ, START and READ NEXT operations do not count toward this total because the runtime is tracking data-altering operations rather than logical record locks. The disadvantage of this method is that when a COMMIT is issued, any record locks held by the runtime are released.

COMMIT-COUNT = -1
No commit is issued by the Acu4GL product. When COMMIT-COUNT is set to -1, two alternate ways to perform a commit or rollback are available:

1. Call "sql.acu" with COMMIT WORK or ROLLBACK WORK.

2. Use the COBOL verbs COMMIT and ROLLBACK, available in ACUCOBOL-GT.

COMMIT-COUNT is set to -1 automatically when you use the transaction management facilities available in the ACUCOBOL-GT compiler. A COMMIT WORK is, however, issued on exit from the runtime (for example, on execution of a STOP RUN).

Examples

A4GL-COMMIT-COUNT  0

A commit will be issued when no locks are held, either because all files that had locked records have been closed, or because a COBOL COMMIT verb has been issued. This is the default value.

Note that some data sources lose the current row when a commit or rollback is executed. For these data sources, a setting of 0 for A4GL-COMMIT-COUNT can adversely affect performance.

A4GL-COMMIT-COUNT  n

A commit will be issued after n operations. WRITE, REWRITE, and DELETE count towards n; READ, START, and READ NEXT do not.

A4GL-COMMIT-COUNT  -1

No commit will be issued by the Acu4GL product. When COMMIT-COUNT is set to -1, the only way to perform a commit or rollback is to use the COBOL verbs COMMIT and ROLLBACK.

A4GL-COMMIT-COUNT is set to -1 internally when you use the transaction management facilities available in ACUCOBOL-GT.

A COMMIT will, however, be issued on exit from the runtime (for example, on execution of a STOP RUN).