3I'Berkeley DB: db_deadlock[P

db_deadlock





db_deadlock [-vw]K    [-a m | o | y] [-h home] [-L file] [-t sec]




Description



BThe db_deadlock utility traverses the database lock structures and5aborts a transaction each time it detects a deadlock.KThis utility should be run as a background daemon whenever multiple threadsor processes are using locking.EBy default, a random transaction involved in the deadlock is aborted.

The options are as follows:

0

-a
When a deadlock is detected,Fabort the oldest (o) transaction, the youngest (y) transaction, or the1transaction with the minimum number of locks (m).>

-h
Specify a home directory for the database.

-L
ILog the execution of the db_deadlock utility to the specified file in theBfollowing format, where ### is the process ID, and the date)is the time the utility starting running.G

    db_deadlock: ### Wed Jun 15 01:23:45 EDT 1995

FThis file will be removed if the db_deadlock utility exits gracefully.^

-t
Initiate a pass over the database locks at least every sec seconds.Y

-v
Run in verbose mode, generating messages each time the detector runs.]

-w
Make a single pass over the database locks every time a process is forcedto wait for a lock.


FAt least one of the -t and -w options must be specified.

PThe db_deadlock utility attaches to one or more of the Berkeley DB shared memoryHregions. In order to avoid region corruption, it should always be givenKthe chance to detach and exit gracefully. To cause db_deadlock to clean up<after itself and exit, send it an interrupt signal (SIGINT).

BThe db_deadlock utility does not attempt to create the Berkeley DBDshared memory regions if they do not already exist. The applicationDwhich creates the region should be started first, and then, once the=region is created, the db_deadlock utility should be started.

The lock_detect function is the underlying function used by the db_deadlock utility.xSee the db_deadlock utility source code for an example of using lock_detectin a POSIX 1003.1 environment.

FThe db_deadlock utility exits 0 on success, and >0 if an error occurs.



Environment Variables





DB_HOME
EIf the -h option is not specified and the environment variableIDB_HOME is set, it is used as the path of the database home, as described8in db_appinit.




See Also

4db_archive,:db_checkpoint, db_deadlock,.db_dump,.db_load,4db_recover,and.db_stat.