Building Distributed
Applications
Using the Progress AppServer


Buffer Currency and NO-LOCK

If you try to find a record with NO-LOCK and that record is already located in a buffer, then depending on the exact nature of the request, Progress may not re-read the record from the database.

The fact that Progress does not always re-read NO-LOCK records may cause unexpected behavior in your distributed application. More specifically, although a record was updated within one session (Client or AppServer), that update may not be seen within another session if that record was previously read with NO-LOCK. There are two scenarios where this may occur. These scenarios are called currency conflicts to denote the fact that they involve a buffer whose contents is not current:

If resolving client-server or server-server currency conflicts is important to you, there are three general approaches that you can use:

Reading the Current Record

If you know exactly which buffer is out of date, use FIND CURRENT or GET CURRENT with NO-LOCK. The CURRENT keyword indicates to Progress that the record must be re-read.

Releasing the Record

Use the RELEASE statement on all buffers that may be out of date before the record is re-read. The RELEASE statement will clear the records from all buffers to which it is applied. At that point, all records that Progress reads will need to be read from the database because a buffer copy no longer exists.

Setting the —rereadnolock Parameter

The -rereadnolock parameter indicates to Progress that when an attempt is made to find a record NO-LOCK, even if the record is already in a buffer, then the record should be re-read from the database. Use it as a 4GL Client startup parameter to resolve Client-Server Currency Conflicts. Use it as an AppServer startup parameter via the Progress Explorer or by setting the srvrStartupParam property in the ubroker.properties file for the appropriate AppServer to resolve Server-Server Currency Conflicts.

Note there are several things to keep in mind when using the —rereadnolock startup parameter:


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095