Re: OO and relation "impedance mismatch"

From: Tony Andrews <andrewst_at_onetel.com>
Date: 5 Oct 2004 09:40:48 -0700
Message-ID: <1096994448.893768.16560_at_k26g2000oda.googlegroups.com>


Kenneth Downs wrote:
> -- This is an RI error trap. Note that it is set-oriented,
> -- and keeps going afterward, even if every row failed.
> -- This trigger also assumes the use of my standard surrogate
> -- key column "skey".
> insert into zuuxtrxerr
(skeytrx,errnum,errop,tabname,errpkey,errdsc)
> select _at_trxNum,13100,@errOp,@errTab,'NO PKEY',
> 'Department Code is not valid'
> FROM inserted i
> WHERE i.custcode NOT IN (
> SELECT i.custcode FROM inserted i JOIN acrmcust t
> ON i.custcode = t.custcode)

Now, what happens if another session deletes (tries to delete) the parent record AFTER this trigger fires, but BEFORE this transaction commits? If this is the only child record for that parent, will the other session succeed in deleting the parent, or are you using a "dirty read" to see the uncommitted record from this session (and vice versa)? Received on Tue Oct 05 2004 - 18:40:48 CEST

Original text of this message