ALLBASE/SQL Reference Manual (36216-90216)

Chapter 5 169
Concurrency Control through Locks and Isolation Levels
Understanding ALLBASE/SQL Data Access
Understanding ALLBASE/SQL Data Access
Concurrent access to data by multiple users is facilitated by the use of a shared data buffer
for all users of an ALLBASE/SQL DBEnvironment. Understanding how this buffer is used
can clarify many concurrency issues.
A DBEnvironment running in multiuser mode is accessed by multiple processes, as shown
in Figure 5-2.
Figure 5-2. Multiuser DBEnvironment
A single data buffer services the needs of all users of the DBEnvironment. In addition,
each interactive user or application program has its own 12K tuple buffer associated with
it. The data buffer holds 4096-byte pages from the DBEFiles in which tables and indexes
are stored. All pages of data requested from tables in the DBEnvironment and all index
pages required for access to the data are read first into this shared data buffer. In the case
of queries, qualifying rows (tuples) are read from the data buffer into the tuple buffer, and
then they are transferred to the screen (in the case of ISQL) or to host variables or arrays
(in the case of an application program). All changes to existing data and index pages are
placed in the data buffer before being written to disk.
The use of the data buffer makes access to data efficient, because pages of data are only
read into the buffer when necessary. These data pages stay in the buffer until they are
swapped out when buffer space is needed for some other page. The use of the buffer also