Re: Imitating Forms ON-LOCK trigger for views.

From: Jens Voiges <Voiges_at_t-online.de>
Date: 1998/04/14
Message-ID: <6h0md4$os6$1_at_news01.btx.dtag.de>#1/1


DanHW schrieb:
>
> >Hi everybody,
> >I'm using blocks based on views. I'm trying to imitate the behaviour of Forms
> >when user tries to change a currently locked record ("Could not reserve
> >record.Keep trying?"). When a user answers with a "No" I should discard all
> >changes the user applied to the current record.
> >All this is done in the ON-LOCK trigger.
> >THE PROBLEM is - the record seems to be locked in the ON-LOCK trigger.
> >None of the built-ins seem to work there. I tried to set the DATABASE_VALUE
> >to the changed item and set record status to QUERY_STATUS - with no success.
> >Any help would be appreciated.
> >Igal.
>
> I'm not sure if this will help , but the approach we take is to put a null; as
> the entire contents of the on-lock trigger (so no locks are placed). In the
> on-insert and on-update triggers, is placed the code to do the actual
> update/insert into one or more tables. This has the effect of placing a very
> short lock on the table (while the actual update statement is done), and the
> last one who saves, 'sticks'.
>
> Dan

And if you place code like
SELECT ... FOR UPDATE NOWAIT in the ON_LOCK trigger, and additionally catch some Exceptions (don't know which at the Moment) you have the original FORMS behaviour. But don't lock the view, of course only the tables you meant.

Jens Received on Tue Apr 14 1998 - 00:00:00 CEST

Original text of this message