Set the lock mode

The lock mode determines what happens when your program encounters locked data. One of the following situations occurs when a program attempts to fetch or modify a locked row:
  • The database server immediately returns an error code in SQLCODE or SQLSTATE to the program.
  • The database server suspends the program until the program that placed the lock removes the lock.
  • The database server suspends the program for a time and then, if the lock is not removed, the database server sends an error-return code to the program.

You choose among these results with the SET LOCK MODE statement.