xa_rollback of Long Running Select Hangs Requesting DX Enqueue in Exclusive Mode (Lock Mode 6) (Doc ID 394298.1)

Last updated on FEBRUARY 08, 2017

Applies to:

Oracle Server - Enterprise Edition - Version: 9.2.0.1 to 10.2.0.3 - Release: 9.2 to 10.2
Information in this document applies to any platform.

Symptoms

If an externally coordinated XA transaction with two branches (pointing to the same database) is rolled back, it is observed that the session performing the rollback hangs on getting a DX lock in exclusive mode (mode 6). Note that in this scenario the first transaction branch B1 is already detached and branch B2 is running a long query. If the xa_rollback tries first to roll back branch B1, the xa_rollback gets blocked by requesting a DX lock in mode 6, since branch B2 is currently holding the DX enqueue in share (S) mode.  However, if branch B2 is rolled back first, and then branch B1 rolled back, the xa_rollback runs fine.

A systemstate dump of this situation looks similar to :

PROCESS 8 [ long running select ]
sql: 386e65200
(enqueue) DX-00000010-00000000 mode: S
LIBRARY OBJECT HANDLE: handle=386e65200
name=select count(*) from emp a, emp b, emp c ,emp d, emp e, emp f , emp g
(trans )
(gtrid 38596df48) 101.585858583332
#branches = 2, type = 0x2
branches = 384cf4838, 384cf4978
transactions = 384ce1db0, 384ce1db0

PROCESS 9 [ xa_rollback ]
(enqueue) DX-00000010-00000000 req: X
(trans )
(gtrid 38596df48) 101.585858583332
#branches = 2, type = 0x2
branches = 384cf4838, 384cf4978
transactions = 384ce1db0, 384ce1db0

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms