Re: lock_record built-in

From: Steve Cosner <stevec_at_zimmer.csufresno.edu>
Date: Mon, 02 Aug 1999 16:45:12 GMT
Message-ID: <sWjp3.14$Sp.728_at_nntp.csufresno.edu>


In article <7o456a$pp3$1_at_fe1.cs.interbusiness.it>, Andrea Colzi <mt_at_multidatagroup.it> wrote:
>Hi
>I'm trying to use the on-lock trigger to get the event of "field modified".
>After my code I put the built-in lock_record (or it's enaugh the lock_record
>command in the trigger) to execute the standard command, but if you test
>it, after the standard message "Could not reserve record etc etc" (that I'd
>like to change as well but how????) forms don't replace what you type with
>the previos value. Why the built-in don't fetch the record's item ? What's
>wrong?
>
>Any other idea to get the "field modified" event?

There is much processing that runs when you issue the Lock_Record command. It does a "Select for update nowait", and also compares the values in this select with the original values first fetched during your query. If the values do not compare, then you get the "Data changed by another user", and if the record is already locked, you get the "Could not reserve record" message.

To bypass all of that, you would need to write your own "select for update nowait" command followed by an exception checking for ORA-0054.

But it sounds like you have other problems going on here. Usually developers do not need to modify the Forms standard record-locking processes. Is it really another user's actions you are trying to take care of, or are you issuing your own SQL Update command elsewhere in the form while still using Forms' default base-table processing? It sounds like you are doing your own SQL Updates, which is something you usually should not do.

If you are just trying to get the "field modified" event, you normally do that in a When-Validate-Item trigger, comparing the new value to the database_value (from get_item_Property), or by keeping a hidden "original value" item in the block.

Good luck!
Steve Cosner



http://members.aol.com/stevec5088
Downloadable Quick Access utility form: Display and update any table. Received on Mon Aug 02 1999 - 18:45:12 CEST

Original text of this message