skip to main content
Designing and coding the IP : SELECT processing : Record locking
 

Record locking

The OpenAccess SDK SQL engine understands SELECT for UPDATE and SELECT for UPDATE NOWAIT forms of the SELECT statement and passes this information down to IP EXECUTE.
Note: It is the responsibility of the IP to perform all necessary record locking and unlocking at the right time.
The COMMIT and ROLLBACK operations are passed down to the IP to assist in implementing a complete and robust locking mechanism. Whether a statement is of type UPDATE with WAIT or UPDATE with NOWAIT is determined by calling dam_getInfo(DAM_INFO_QUERY_HAS_NOWAIT). If NOWAIT is specified and the record cannot be locked, the IP should return an error.
When the application is operating in auto-commit mode, the OpenAccess SDK Client does not call COMMIT after a SELECT statement. If you have locked any records during a SELECT then you need to unlock them before exiting IP EXECUTE. You can get the current transaction mode by calling dam_getInfo(DAM_INFO_TXN_TYPE).