# Db2 SQL0911N: The current transaction has been rolled back because of a deadlock or timeout (reason code 68)

**Code:** `SQL0911N` · **Category:** SQL · **Seen on:** Db2, SQL

Db2 rolled the transaction back because it hit a lock timeout (68) or a deadlock (2).

## Meaning

Read the reason code: 68 = lock timeout (`LOCKTIMEOUT`), 2 = deadlock. Retry the transaction, keep it short, access objects in a consistent order, add indexes to reduce locked rows, and consider currently committed semantics / isolation level changes.

## Common causes

- Long transaction holding locks (reason code 68)
- Deadlock between two applications (reason code 2)
- Missing index causing table scans
- LOCKTIMEOUT too low
- Uncommitted work in another session

## Quick fix

1. Retry on SQL0911N
2. Keep transactions short and commit sooner
3. Find the blocker with `MON_GET_LOCKS` / `db2pd -locks`

## Detailed fix by platform

### Shell

1. 

```sql
db2 get db cfg | grep -i locktimeout
db2pd -db SAMPLE -locks
```


## How to diagnose

1. **Reason code** — 2 or 68?
2. **Blocker** — Which app?
3. **LOCKTIMEOUT** — Value?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/sql/db2-sql0911n-deadlock-or-timeout)
