unable to get the latest value with NO-LOCK

Posted by umityaz on 05-Jul-2007 05:11

When more than 1 client using the program, it does not give me the latest value if another user changes the current value of the field. I don't need to update the field, I only need the current value, therefore I don't want to use EXCLUSIVE-LOCK.

FIND FIRST myTable NO-LOCK.

MESSAGE myTable.myField1.

All Replies

Posted by Admin on 05-Jul-2007 05:27

There are two ways of getting there:

One is the use of FIND CURRENT after the FIND FIRST. FIND CURRENT re-reads from the DB and does not used the client cache, that might have an outdated value.

Second option would be the usage of the -rereadnolock client startup parameter. Check K-Base ID: 19063 Title: "What is the -rereadnolock parameter ?" for additional info.

The usage of the first or the second option is deciding between programming over head or take some network overhead, as any read goes back to the db server over the network.

Depends on how big your issues with data currency are. For state-less AppServers I'd always go with -rereadnolock.

Mike

Posted by umityaz on 05-Jul-2007 06:55

thx for the answer. It solved our problem.

This thread is closed