Sunday, July 3, 2016

Oracle RAC enq: TX - row lock contention on distributed transactions

If your program is using distributed transactions against an Oracle RAC, you need to configure your program to point to a single RAC node. The solution was to alter the TNSNAMES.ORA file to use a service_name that was bound to a single RAC node, but had hot fail over setup to jump to another node if the specified node went down.

Configuration:


  • Oracle 11.2.0.4 RAC
  • .Net applications
    • System.Transaction
    • odp.net 4.112.3.0


This problem can be seen in the Oracle documentation under bug 13361419. (Note that Oracle My Support access is paid which is one reason I am posting this issue.)

"ORA-2049 can be observed when there are modifications to two or more tables in a distributed
transactions where :

- there is a foreign key relationship between the tables and under the circumstances of this particular issue :

  - there was an insert into tableA on node 1 ; table A has a pk
  - there was an insert into tableB on node 2 in the same txn ; tableB has a foreign key reference to the 
    primary key in tableA
- a locking situation is observed where a branch may appear to be blocking waiting on event :
  'enq: TX - row lock contention'"