Exclusive Lock On Tables Due To Primary Key And "If Inserting" Block In Trigger (Doc ID 1494162.1)

Last updated on SEPTEMBER 19, 2016

Applies to:

Oracle Database - Enterprise Edition - Version 10.2.0.4 and later
Information in this document applies to any platform.

Symptoms

A row exclusive lock on child tables is obtained if trigger code references the primary key of a table in the "if inserting" block, even though the triggering statement is an update, and the "if inserting" code is not firing.   This can result in performance issues under load fora  frequently updated table.

It is expected that a row exclusive lock be obtained during an insert, but in this case an UPDATE is issued, however the presence of the primary key reference in the INSERTING clause still results in an exclusive lock.

 

The behavior can be reproduced with the following:

 

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