irisjs.set('exclusive node','nodeOne');
irisjs.set('shared node','nodeTwo');
// unlike global names, lock references *must* start with circumflex
const nodeOneRef = '^nodeOne';
const nodeTwoRef = '^nodeTwo';
try {
irisjs.tStart();
irisjs.lock('E',10,nodeOneRef,''); // lock nodeOne exclusively
irisjs.lock('S',10,nodeTwoRef,''); // lock nodeTwo shared
console.log('Exclusive lock on nodeOne and shared lock on nodeTwo');
alert('Press return to release locks individually');
irisjs.unlock('D',nodeOneRef,''); // release nodeOne after transaction
irisjs.unlock('I',nodeTwoRef,''); // release nodeTwo immediately
alert('Press return to commit transaction');
irisjs.tCommit();
}
catch { console.log('error'); }