Entering content frame

 Example: Reading Data Consistently Without Locking (Live Cache) 

Undo log entries are used by liveCache database instances so that several transactions are able to access the same data record at the same time and read it consistently, without it having to be locked against one of the transactions.

...

       1.      Transaction T1 reads data record 4711 in a table for the first time. Transaction T1 does not lock the data record.

       2.      Transaction T2 modifies data record 4711 and ends with a COMMIT.

       3.      Transaction T1 reads data record 4711 again.

       4.      Transaction T1 checks the history file to see whether another transaction has modified data record 4711 since it was first read by transaction T1.

If this is the case, transaction T1 accesses the undo-log entries of transaction T2 so it can get the same result in the second reading as it did in the first. Without the undo-log entries, transaction T1 would get a different result each time it read data record 4711.

       5.      The garbage collectors delete the undo-log entries from transaction T2 only after transaction T1 has been ended with a COMMIT.

Only liveCache database instances can read consistently in this way, without being locked. With OLTP instances data record 4711 has to be locked until transaction T1 has ended. This is made possible by an appropriate selection of the isolation level.

 

Leaving content frame