pjs.rollBack()
The pjs.rollBack() API rolls back pending changes to all files that are open under commitment control.
This is only supported with the IBM i database and not using SQL.
RPG Equivalent
ROLBK
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();