pjs.commit()
The pjs.commit() API commits pending changes to all files that are open under commitment control.
This is only supported with the IBM i database and not using SQL.
Parameters
- Boundary (optional)
RPG Equivalent
COMMIT
Example
pjs.defineTable("ordheader", { write: true, commit: true }); pjs.defineTable("orddetail", { write: true, commit: true }); try { Â ordheader.write(); orddetail.write(); Â } catch (error) { Â // One of the records failed to write, rollback changes. pjs.rollBack(); Â } Â // Both records written, commit changes. pjs.commit();