Sunday, December 11, 2016
Tip of the Day: New PAGELOCK Setting in R:BASE X/XE (Version 10)
Product.......: R:BASE X/X Enterprise (Version 10)
Build.........: 10.0.1.10522 or higher
Section.......: Settings
Keywords......: PAGELOCK, Page Locking, Multi-User
Did you know that R:BASE X/XE (Version 10) includes a new (actually separate)
PAGELOCK operating condition, which specifies how R:BASE locks data in a
multi-user environment, based on the position of the row in the data file?
Sound familiar? It should!
Previously the R:BASE operating condition was controlled by QUALCOLS as a dual-
functioning setting, specifying unique columns for ODBC tables and for page
locking.
Now page locking (PAGELOCK) is separate from ODBC unique columns (QUALCOLS).
What does this mean for R:BASE X/X Enterprise users?
Application code must be updated to add PAGELOCK and set the
condition to ON/OFF
appropriately where QUALCOLS was used for page locking. Examples
below demonstrate
the setting could also be used dynamically in case-by-case instances
to increase
multi-user performance.
To summarize the code changes, if you used SET QUALCOLS 2 for faster
page locking,
add SET PAGELOCK OFF to your code. If you used SET QUALCOLS 10 to
enforce a page
lock for a faster UPDATE process, add SET PAGELOCK ON to your code.
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.
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 most 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 many 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
Very Best R:egards,
Razzak.
www.rbase.com
www.facebook.com/rbase
--
33 years of continuous innovation!
18 Years of R:BASE Technologies, Inc. making R:BASE what it is today!
--
--
You received this message because you are subscribed to the Google Groups
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.