Please enable JavaScript.
Coggle requires JavaScript to display documents.
DB Transactions (States (failed (if any of the checks made by the database…
DB Transactions
-
-
-
failed
-
-
when a normal execution is no longer possible (logical error: bad input..., system error: deadlock, ...., or system crash)
aborted
the recovery manager rolls back all its write operations on the database to bring the database back to its original state (prior to the transaction execution: last consistent state)
-
-
Serializability
-
Serial schedule
-
-
In a multi-transaction environment, results may be different when transactions are working on the same data
-
Defintion
-
-
-
execution schema
-
-
3 -
3.b - If an error occurs, then roll back the transaction.
3.a - If no error occurs, then commit the transaction.
-
Concurrency control
-
Lock-based Protocols
-
4 protocol types
Pre-claiming Lock Protocol evaluates the transactions operations // creates a list of required locked data items
Simplistic Lock Protocol transactions obtain a lock on every object before a 'write' operation is performed. Transactions may unlock the data item after completing the ‘write’ operation.
-
-
-
RDBMS Oracle, MS SQL Server, IBM DB2, PostgreSQL, MySQL
Components within DBMS
Scheduler
provides a specific strategy for the execution of transactions and the corresponding concurrency control
-
-
Recovery Manager
restore the database to the state it was in before a failure occurred (e.g. due to software bug or hardware problem) while executing one or multiple transactions
-
concurrency problems
Dirty read (Temporary Update) A transaction updates an item, then fails then the item is accessed by another transaction before rollback
Non-Repeatable Read A transaction reads an item twice and gets different values because of concurrent change
Phantom Read A transaction executes a query twice, and obtains a different numbers of rows because another transaction inserted new rows meantime
-
Incorrect Summary One transaction is calculating an aggregate function on some records while another transaction is updating them
Deadlock
-
-
-
-
detection & recovery
-
2- [detected deadlock], one of the transactions is killed, then restarted
-
A transaction should maintain these properties to ensure accuracy, completeness, and data integrity.
multiple transactions to be executed by the OS in a multi-programming environment,
-
-
[multi-programming environment] + [multiple simultaneous transactions] Need for concurrency control protocols to ensure atomicity, isolation, and serializability of concurrent transactions.
-
DBMS equipped with lock-based protocols like Oracle, SQL Server, ...
-
The most commonly used concurrency protocol is the timestamp based protocol. This protocol uses either system time or logical counter as a timestamp
-
-
-