Explicit locking: When a transaction repeatedly accesses a table or a part of the database, it can explicitly lock it. Instead of locking some rows, it lock the entire table.
Advantages of explicit locking:
1) By explicit locking the transaction makes sure that it has locked the entire table for itself. That way, other transactions cannot acquire a lock over this table.
2) Processing overhead is greatly reduced by using explicit locking.
3) When explicit locking is used, there can’t be any deadlocks.
Disadvantage of explicit locking: Other transactions have to wait for the first transaction to finish.
In IBM database, to lock a particular table, LOCK TABLE statement is used. Here are the modes which can be used with the LOCK TABLE statement:
EXCLUSIVE mode: By this mode the locking is exclusive and other transactions cannot access the table.
SHARE mode: By this mode the locking is exclusive and other transactions can read the table. However, they cannot update it.