The 4GL_COMMIT_COUNT variable sets the conditions in which Database Connectors issues 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, the alternatives are:
A COMMIT WORK is, however, issued on exit from the run time system (for example, on execution of a STOP RUN).
Examples
4GL_COMMIT_COUNT 0
A commit is issued when no locks are held, either because all files that had locked records are 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, setting 4GL_COMMIT_COUNT to 0 can slow performance.
4GL_COMMIT_COUNT n
A commit is issued after n operations. WRITE, REWRITE, and DELETE count towards n; READ, START, and READ NEXT do not.
4GL_COMMIT_COUNT -1
No commit is issued by Database Connectors. When 4GL_COMMIT_COUNT is set to -1, the only way to perform a commit or rollback is to call your database query tool with COMMIT WORK or ROLLBACK WORK.