PROIV has three Logic language features that allow you to exercise direct control over the execution of commit and rollback. These are the COMMIT() and ROLLBACK() statements and the &#@SUPP-COMM switch.

It is recommended practice to structure application functions around the automatic commits and to use the COMMIT() statement only when necessary.  Special care is needed when using explicit commits.  Functions programmed using explicit commit are harder to understand and may be less portable to other transaction-processing environments.

COMMIT()

This statement causes an immediate commit to be performed.  This will result in the release of locks on recoverable resources and the losses of read and write currency on those resources. 

If a commit fails, an automatic rollback occurs and control is not returned to the logic routine.

ROLLBACK() 

This statement causes an immediate rollback to be performed.  This will result in the release of locks on recoverable resources and the losses of read and write currency on those resources.

If a rollback fails, the PROIV session is terminated with a warning message as described above for Automatic Rollback.

&#@SUPP-COMM

If this switch is set via the statement ENABLE($#@SUPP-COMM) then automatic commits will be suppressed until a subsequent DISABLE(&#@SUPP-COMM) statement.  Explicit commits programmed using the COMMIT() statement are not affected.  This switch can be used to extend a transaction across multiple functions.

Comment on this topic

Topic ID: 720044