Syntax: SET PAGELOCK ON/OFF
Mode: Multi-user
Default: ON
PAGELOCK specifies how R:BASE locks data when updating and deleting rows.
The settings for PAGELOCK are:
•ON - R:BASE uses page locking or row locking as appropriate. When PAGELOCK is ON and two or more users are updating rows within the same page of data, R:BASE only lets the first user update rows--the other users are locked out until the first user's update has been completed.
•OFF - R:BASE uses a fast row-locking method where only row locking is applied with no page locking. When PAGELOCK is OFF, you can lock rows of data instead of locking a page of data. You increase multi-user performance when PAGELOCK is OFF. And even more so when STATICDB and FASTLOCK are on.
Control Row Locks with SET PAGELOCK
If you know that your application mainly updates or deletes data a row at a time, rather than many rows, set PAGELOCK to OFF for row locking. In this case, R:BASE locks a row, reads the row, makes the change, and then releases the row. Otherwise, set PAGELOCK ON for page locking when you are doing an UPDATE and/or DELETE affecting many rows in a table.
Keep in mind that the PAGELOCK setting can be changed dynamically and can be different for different users using the same database.
Technically, the efficient and fastest method for updating data in multi-user environment is to SET STATICDB ON, SET FASTLOCK ON, and SET PAGELOCK OFF. This particular combination will result in the fewest contentions between users.
Notes:
•FASTLOCK and PAGELOCK can be set on at the same time.
•Setting STATICDB and FASTLOCK to ON (in that order), with PAGELOCK set to OFF will significantly increase multi-user performance with individual row changes.
•PAGELOCK is not the same as SET ROWLOCKS.
•Setting the value of PAGELOCK does not change the setting of ROWLOCKS.
•The PAGELOCK setting can be changed dynamically and can be different for different users using the same database.
Example:
-- The UPDATE must alter the values for may rows
SET FEEDBACK ON
SET PAGELOCK ON -- use page locking
UPDATE <tablename> SET <columnname> = value -- no WHERE Clause
SET PAGELOCK OFF -- use row locking
SET FEEDBACK OFF
CLS