Try OpenEdge Now
skip to main content
Application Migration and Development Guide
Application Development with PAS for OpenEdge : Design and Implementation Considerations : Transaction and record management considerations : Buffer currency and NO-LOCK : Setting the -rereadnolock parameter
 
Setting the -rereadnolock parameter
The -rereadnolock parameter indicates to the AVM 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 reread from the database. Use it as an ABL client startup parameter to resolve client-server currency conflicts. Use it by setting the sessionStartupParam property in the PAS for OpenEdge openedge.properties file for the appropriate server to resolve server-server currency conflicts.
There are several things to keep in mind when using the -rereadnolock startup parameter
*The -rereadnolock parameter has no affect on records that are being retrieved via RECID or ROWID. In that case, the AVM will not reread the record. It will use the copy of the record already stored in the buffer. If the most current version of the record is needed, then use the RELEASE statement on all buffers that contain a copy of the record before reading the record, or use FIND CURRENT or GET CURRENT statement to reread the record.
*The -rereadnolock parameter has no affect on the behavior of the query cache used for a NO-LOCK query as specified via the CACHE n phrase of the DEFINE QUERY statement. If the record is in the cache, it will not be reread regardless of whether -rereadnolock is set. To force the record to always be reread set CACHE 0. Note that setting the cache size to zero (0) may significantly degrade performance if the database is being accessed across a network. Only set the cache size to zero (0) when it is critical to retrieve the most current version of a record.
*The -rereadnolock parameter has no affect on the behavior of the prefetch cache that is used by default when retrieving records NO-LOCK across the network. By default, when executing a CAN-FIND function, or the FIND, FOR, or OPEN QUERY statements on a database which is being accessed across a network, the AVM fetches several records at a time, and stores those records within a prefetch cache. the AVM will only sends a request to the database server to fetch more records if the requested record is not contained within the current prefetch cache. If the record is in this cache, a new copy of that record will not be read even if -rereadnolock is set. To eliminate this cache so that the most current version of the record is always read use the NO-PREFETCH keyword in the appropriate statements. Note that using the NO-PREFETCH keyword may significantly degrade performance. Only set NO-PREFETCH when it is critical to retrieve the most current version of a record.