Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Deadlocking in Oracle
On Wed, 01 Aug 2001, sanjayDELETECAPS_at_lexisnexis.com wrote:
> 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
-- Galen Boyer It seems to me, I remember every single thing I know.Received on Wed Aug 29 2001 - 21:29:18 CDT