Re: delete cascade

From: Bob Badour <bbadour_at_pei.sympatico.ca>
Date: Wed, 18 Apr 2007 19:11:25 GMT
Message-ID: <x3uVh.25755$PV3.263119_at_ursa-nb00s0.nbnet.nb.ca>


jonnie wrote:

> Could you please point me to any information about deadlock caused by
> cascade delete.
>
> I have never heard of this and I am more than a little bit paranoid.
>
> Thank you.
>
> Sincerely,
> Jon Savell

Any bulk update runs the risk of deadlock. It's not that big a deal. The DBMS detects the deadlock, rolls somebody back and issues an error to the rolled back transaction.

How the data are clustered will affect the potential for deadlock. For example, if one clusters invoice items by their invoice#, the risk of contention when deleting by invoice# is greatly reduced.

The type of indexes used and their implementation specifics can affect the risk too.

And then of course, the concurrency model and lock granularity affect the risk too.

In any case, anything resembling a decent application will have some sort of error handling scheme and decision process even if that scheme is "Report it to a human and let the human decide." Received on Wed Apr 18 2007 - 21:11:25 CEST

Original text of this message