Re: Imitating Forms ON-LOCK trigger for views.

From: Patrick Wolf <patrick.wolf_at_telekabel.at>
Date: 1998/04/18
Message-ID: <35390c7c.5102677_at_news.telekabel.at>#1/1


Hi,

if the lock with the SELECT ... FOR UPDATE fails, you can do a RAISE FORM_TRIGGER_FAILURE, this will restore the original values of the fields.

Patrick

On 14 Apr 1998 22:02:12 GMT, Voiges_at_t-online.de (Jens Voiges) wrote:
>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



Patrick Wolf
Working for Scientific Games, Vienna

E-Mails: patrick.wolf_at_telekabel.at (home)

         wolf_at_scigames.at (work) Received on Sat Apr 18 1998 - 00:00:00 CEST

Original text of this message