Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Deadlocking in Oracle

Deadlocking in Oracle

From: Sanjay Sharma <sanjayDELETECAPS_at_lexisnexis.com>
Date: Wed, 01 Aug 2001 11:00:17 -0400
Message-ID: <3B681981.C1D49B80@lexisnexis.com>

I am running into a deadlock situation and would like to get some suggestions on how to avoid it. I am using OCI to do the following

Starting OCI transacation (implicit)
//Execute the following sql through OCI
Delete MyTable where id="123"; // Delete multiplr rows if delete fails OCITransRollback;
Insert INTO MyTable (id, name, val) VALUES ('123', 'n1', 'v1') if insert fails OCITransRollback;
Insert INTO MyTable (id, name, val) VALUES ('123', 'n2', 'v2') if insert fails OCITransRollback;
Insert INTO MyTable (id, name, val) VALUES ('123', 'n3', 'v3') if insert fails OCITransRollback;
else OCITransCommit;

Under heavy load above pesdu methods causes deadlock. Note it is possible that multiple clients are using the same id to insert and delet rows. I have checked to make sure I rollback in case of all failures and commit in case of success.

Sanjay Received on Wed Aug 01 2001 - 10:00:17 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US