Subject: INSERT HANGS ACQUIRING LOCK/BLOCKS OTHER INSERTS WHERE BITMAP INDEXES ARE USED
Doc ID: Note:191561.1 Type: TROUBLESHOOTING
Last Revision Date: 21-OCT-2005 Status: PUBLISHED
PROBLEM
=======
INSERT HANGS ACQUIRING LOCK THAT BLOCKS OTHER INSERTS
PROBLEM DESCRIPTION
===================
When a row is inserted into a relational table, it acquires lock and
blocks other inserts until the first insert is either committed
or rolled back
Running utllockt.sql from other session shows the following :
WAITING_SESSION LOCK_TYPE MODE_REQUESTED MODE_HELD LOCK_ID1 LOCK_ID2
--------------- ----------- -------------- --------- -------- --------
34 None
48 Transaction Share Exclusive 262239 5748
All the indexes and the constraints were checked and were proper.
There is a bitmap index on the particular table
SOLUTION
========
Remove the bitmap index and use normal index to this table and
insert the rows again.
SOLUTION EXPLANATION
=====================
Bitmap index was the cause for this lock.
Each 'entry' in a bitmap index can cover many rows in the actual table.
If 2 sessions wish to update rows covered by the same bitmap index
fragment then the second session waits for the first transaction to
either COMMIT or ROLLBACK by waiting for the TX lock in mode 4(SHARE).
When the bitmap index was removed and replaced by normal index, the
insert worked regardless of any values.
Partager