Understanding DB2: Learning Visually with Examples (2nd Edition)
11.9. Summary
In this chapter you learned about locking scenarios that you may encounter when a database is concurrently manipulated. Some scenarios might be desirable, but some are not. To control the behavior of how DB2 handles concurrent database access, use the different isolation levels. There are four types of isolation levels: uncommitted read, cursor stability (the default), repeatable read, and read stability. The behavior of DB2 locking and lock attributes are controlled by the isolation level specified for the database. When an application is holding many locks that have exceeded its quota (through the setting of MAXLOCKS), lock escalation may occur. Lock escalation should be minimized as much as possible because it significantly reduces the concurrency of the database. There are command line tools as well as graphical tools that can help you identify and solve locking problems, and you can implement techniques when developing your applications to avoid locking. |