Explicitly locking LOB tables

The reasons for using LOCK TABLE on an auxiliary table are somewhat different than that for regular tables.

About this task

Begin program-specific programming interface information.
You might use the LOCK table statement for lobs for any of the following reasons:

Procedure

To manage locks for auxiliary tables spaces for LOB data, use the following approaches:

  • Use LOCK TABLE to control the number of locks acquired on the auxiliary table. By doing so, you can eliminate the need for lower-level LOB locks.
  • Use LOCK TABLE IN SHARE MODE to prevent other applications from inserting LOBs. With auxiliary tables, LOCK TABLE IN SHARE MODE does not prevent any changes to the auxiliary table. The statement does prevent LOBs from being inserted into the auxiliary table, but it does not prevent deletes. Updates are generally restricted also, except where the LOB is updated to a null value or a zero-length string.
  • Use LOCK TABLE IN EXCLUSIVE MODE to prevent other applications from accessing LOBs. With auxiliary tables, LOCK TABLE IN EXCLUSIVE MODE also prevents access from uncommitted readers.
    End program-specific programming interface information.