Forms, triggers and deadlocks

From: jeff davidson <davidson_at_ix.netcom.com>
Date: 1996/08/31
Message-ID: <3228633B.464_at_ix.netcom.com>#1/1


Hi. For purposes of example, we have two tables, DEPT, the parent table and
EMP, the child table. We have created a form implementing this master-detail
relationship.

User A changes an EMP field on the form. This results in forms taking out a row
lock via select for update. User B updates the master record in DEPT for this employee, which in turn fires a back end trigger which updates all the
employee detail records. Since user A still has the lock, user B hangs (until user A gets back from vacation).

I see 3 possible solutions:

  1. Any time a detail is updated, a lock is manually taken out on the master record. This doesn't seem workable since in practice we are 5-6 levels deep and we'd have to propagate locks all the way up the tree.
  2. The trigger does a select for update nowait before touching the details. If this fails, raise application error and inform user. This works but means we have to change all our trigger code and may result in performance degradation.
  3. Use forms deferred mode locking. I'm not sure of the implications here. Anybody tried this?

Anybody have any other ideas?

thanks,
jeff
p.s. Is there a seperate forms newsgroup? Received on Sat Aug 31 1996 - 00:00:00 CEST

Original text of this message