The present invention relates to a method of handling the risk of a deadlock between simultaneous transactions (T1, T2) in a database (1). The method is based on allocating to respective objects (01, 02) in the database (1) a lockout queue (L1, L2) in which transactions (T1, T2, T3, ..., T8) that request access to an object (01, 02) are placed to await the access to said object of a preceding transaction. The handling procedure comprises going through, or perusing, the lockout queues (L1) belonging to different objects (01) to detect so-called locking transactions (T1) that can cause a deadlock and, subsequent to detection, comparing said locking transaction with other transactions (T2, T6, T1, T7, T8) in other lockout queues (L2) therewith enabling the risk of deadlock between a first and a second transaction (T1, T2) that have both requested access to the same first and second object (01, 02) to be detected. Combinations of transactions that are ongoing or active in the database and that, according to said comparison, can cause a deadlock are divided into locking and non-locking combinations respectively. Solely the detection of a locking combination will cause further action to be taken.
展开▼