In a WebDev project, if your application updates AS/400 files using HModify , you need to:
• Either explicitly lock the record before to update it,
• Or follow the rules described here after:
If you don’t explicitly lock records before update with HModify , you need to customize the management of lock errors with:
HOnError("*",hErrLock,"OnLockError")
Insert this statement in the project initialization, after opening the connection
HOpenConnection(MyConnection)
HOnError("*",hErrLock,"OnLockError")
The minimum source for the procedure is :
// global Procedure
PROCEDURE OnLockError()
RETURN opCancel
END
When a record update is requested while the record is not
locked, WebDev will lock the record and check if it was changed, only if an
error procedure exists for lock errors.
Otherwise, WebDev will not try to lock the record, and the AS/400 system will
fail.