O'Reilly logo

Berkeley DB by Sleepycat™ Software, Inc.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Configuring Locking

The DBENV→set_lk_detect function specifies that the deadlock detector should be run whenever a lock blocks. This option provides for rapid detection of deadlocks at the expense of potentially frequent invocations of the deadlock detector. On a fast processor with a highly contentious application where response time is critical, this is a good choice. An argument to the DBENV→set_lk_detect function indicates which transaction to abort when a deadlock is detected. It can take on any one of the following values:

  • DB_LOCK_YOUNGEST Abort the most recently started transaction.

  • DB_LOCK_OLDEST Abort the longest-lived transaction.

  • DB_LOCK_RANDOM Abort whatever transaction the deadlock detector happens to find first.

  • DB_LOCK_DEFAULT ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required