The value of 4GL_COMMIT_COUNT indicates the conditions under which you want to issue an automatic COMMIT-WORK operation. Valid values are:
| "0"
(Default) |
The run-time system tracks the number of logical locks that are currently in effect. When the number of logical locks reaches zero, the run-time system assumes that a transaction is complete and issues a COMMIT statement |
| "n" | When set to a nonzero value, the run-time system tracks the number of WRITE, REWRITE, and DELETE operations, until the value of 4GL_COMMIT_COUNT is reached, at which time the run-time system issues a COMMIT statement. The READ, START, and READ NEXT operations do not count toward this total, because the run-time system 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 run-time system are released |
| "–1" | No commit is issued by Database Connectors™ |
When 4GL_COMMIT_COUNT is set to "-1", two alternate ways to perform a commit or rollback are available:
4GL_COMMIT_COUNT is set to "-1" automatically when you use the transaction management facilities available in the Compiler. A COMMIT WORK is, however, issued on exit from the run-time system (for example, on execution of a STOP RUN).
4GL_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 4GL_COMMIT_COUNT can adversely affect performance.
4GL_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.
4GL_COMMIT_COUNT –1
No commit will be issued by Database Connectors. When 4GL_COMMIT_COUNT is set to "-1", the only way to perform a commit or rollback is to use the COBOL verbs COMMIT and ROLLBACK.
4GL_COMMIT_COUNT is set to "-1" internally when you use the transaction management facilities available in your COBOL development system.
A COMMIT will, however, be issued on exit from the run-time system (for example, on execution of a STOP RUN).
Notes: