/
pjs.commit()

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.




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();