Supported RPG Features

A database file is placed under commitment control with the COMMIT keyword on its DCL-F. Within the program, COMMIT makes all pending changes to the files under commitment permanent (advancing the transaction boundary), and ROLBK discards them:

DCL-F AROPEN DISK KEYED USAGE(*UPDATE) COMMIT;

UPDATE(E) AROPENR;
IF %ERROR;
  ROLBK;          // discard the unit of work
  RETURN;
ENDIF;
COMMIT;           // make the unit of work permanent

COMMIT and ROLBK act on the JDBC connection that backs the files under commitment control. When any DCL-F carries the COMMIT keyword, the program runs that connection with autocommit turned off so that individual writes accumulate into a unit of work; COMMIT then makes the group permanent and ROLBK discards it (also releasing record locks). A program with no files under commitment control performs no transaction management.