Please enable JavaScript.
Coggle requires JavaScript to display documents.
1.6 Database - Transaction Processing (Timestamp Ordering (Screenshot…
1.6
Database - Transaction Processing
Record Locking
Record locking prevents simultaneous access to objects in a database in order to prevent updates being lost or inconsistencies in the data arising
•Using record locking, a record is locked when a user retrieves it for editing or updating
Anyone else attempting to retrieve it is denied access until the transaction is completed or cancelled
Problems with Record Locking
If two users are attempting to update two records, a situation can arise in which neither can proceed, known as deadlock
Serialisation
The Database Management System (DBMS) must prevent such situations from arising
Serialisation ensures that transactions do not overlap in time and therefore cannot interfere with each other or lead to updates being lost
Serialisation techniques include:
•Timestamp ordering
•Commitment ordering
Commitment Ordering
This is another serialisation technique to ensure that no transactions are lost if two clients are simultaneously trying to update a record. Transactions are ordered in terms of their dependencies on one another as well as the time they were initiated
It can be used to prevent deadlock by blocking one request until another is completed
Timestamp Ordering
These are updated whenever an object is read or written
Every object in the database has a read timestamp and a write timestamp
When a user tries to save an update, if the read timestamp is not
the same as it was when they started the transaction, the DBMS
knows another user has accessed the same object
The transaction will be cancelled and a message
“Update unsuccessful” sent to the user
Redundancy
Many organisations cannot afford to have their computer systems go down for even a short time
Imagine the chaos if the air traffic control system goes down…
Many organisations have built-in redundancy in their computer systems
Duplicate hardware, located in different geographical areas, mirrors every transaction that takes place on the main system
If this fails, the backup system automatically takes over