Sunday, November 10, 2013

Dirty read in ABAP

SAP systems are based on Relational Database Management System (RMDB) systems or simply said database systems. That’s basically the place where all the data of the systems is stored in. There is an isolation property defined in databases. It is about definition when changes to the database are visible to other simultaneous or concurrent operations. Just side note isolation is one of ACID (Atomicity, Consistency, Isolation and Durability) properties of the databases.

From particular database systems point of view the isolation topic falls under one of phenomenas. Particular database recognizes phenomena during processing of concurrent transactions. If situation in the database is unclear we call it the phenomena. There are following phenomenas defined in e.g. SAP MaxDB as it follows ANSI/ISO standard SQL 92:

  • Dirty Read
  • Non-Repeatable Read
  • Phantom
With respect to Dirty Read: there is a situation when A row is modified in the course of a transaction T1, and a transaction T2 reads this row before T1 has been concluded with the COMMIT statement. T1 then executes the rollback statement, i.e. T2 has read a row that never actually existed. So it is dirty because we are not sure if we getting real data by that read statement.

Basically ABAP programmer should always try to avoid the phenomenas when designed locking behavior of custom tables.

Used sources:

No comments: