Display information about transaction locks

The output of the onstat -k command contains details on the locks that a transaction holds.

To find the relevant locks, match the address in the userthread column in onstat -x output to the address in the owner column of onstat -k output.

onstat -k and onstat -x output shows sample output from onstat -x and the corresponding onstat -k command. The a335898 value in the userthread column in the onstat -x output matches the value in the owner column of the two lines of onstat -k output.
Figure 1: onstat -k and onstat -x output
onstat -x

Transactions
address  flags userthread locks   beginlg curlog  logposit   isol    retrys coord
a366018  A---- a334018    0      0       1       0x22b048  COMMIT  0      
a3661f8  A---- a334638    0      0       0       0x0       COMMIT  0      
a3663d8  A---- a334c58    0      0       0       0x0       COMMIT  0      
a3665b8  A---- a335278    0      0       0       0x0       COMMIT  0      
a366798  A---- a335898    2      0       0       0x0       COMMIT  0      
a366d38  A---- a336af8    0      0       0       0x0       COMMIT  0      
 6 active, 128 total, 9 maximum concurrent

onstat -k 

Locks
address  wtlist   owner    lklist   type     tblsnum  rowid    key#/bsiz
a09185c  0        a335898  0        HDR+S    100002   20a         0   
a0918b0  0        a335898  a09185c  HDR+S    100002   204         0   
 2 active, 2000 total, 2048 hash buckets, 0 lock table overflows
In the example in onstat -k and onstat -x output, a user is selecting a row from two tables. The user holds the following locks:
  • A shared lock on one database
  • A shared lock on another database