Start of Content Area

Background documentation Which Accesses Proceed Directly to the Database?  Locate the document in its SAP Library structure

When programming accesses to buffered tables it is important to know which accesses read from the buffer and which accesses go directly to the database.

The following accesses always bypass the buffer and proceed directly to the database:

·        SELECT... BYPASSING BUFFER

·        SELECT FOR UPDATE

·        SELECT with aggregate function, for example COUNT, MIN, MAX, SUM, AVG

·        SELECT DISTINCT

·        SELECT... WHERE... IS NULL

·        ORDER BY (with the exception of PRIMARY KEY)

With generic buffering, all SELECT statements that do not fully specify the generic key also proceed directly to the database. Therefore, with generic buffering the buffer can only be used for accesses that specify the complete generic key.

With single-record buffering, each SELECT statement without the suffix SINGLE also proceeds directly to the database. This applies even if the complete key is specified in the SELECT statement. In single-record buffering, therefore, the buffer can be used only for accesses with SELECT SINGLE.

Of course, all accesses with Native SQL (EXEC SQL) also bypass the buffer and proceed directly to the database. Such accesses should be avoided at all costs with buffered tables. First of all, read accesses always bypass the table buffers. Secondly, the SAP system does not notice modifying accesses since no entries are made in the synchronization table here (see Synchronization of Local Buffers). This can lead to inconsistencies between the data in the buffers of the application server and the database.

 

End of Content Area