Ch 10 Flashcards
Transaction
A transaction is a logical unit of work that must be entirely completed or entirely aborted; no intermediate states are acceptable.
Consistent database state
A consistent database state is one in which all data integrity constraints are satisfied.
Database request
A database request is the equivalent of a single SQL statement in an application program or transaction. E.g. if a transaction is composed of two UPDATE and one INSERT statement, the transaction uses three database requests.
Atomicity
Atomicity requires that all operations (SQL requests) of a transaction be completed; if not, the transaction is aborted.
Consistency
Consistency indicates the permeance of the database’s consistent state. A transaction takes a database from one consistent state to another. When a transaction is completed, the database must be in a consistent state; if any of the transaction parts violates an integrity constraint, the entire transaction is aborted.
Isolation
Isolation means that the data used during the execution of a transaction cannot be used by a second transaction until the first one is completed.
Durability
Durability ensures that once transaction changes are done and committed, they cannot be undone or lost, even in the event of a system failure.
Serializability
Serializability ensures that the schedule for the concurrent execution of the transactions yields consistent results. This property is important in multiuser and distributed databases in which multiple transactions are likely to be executed concurrently. Naturally, if only a single transaction is executed, serializability is not an issue.
Transaction log
A DBMS uses a transaction log to keep track of all transactions that update the database.
Concurrency control
Coordinating the simultaneous execution of transactions in a multiuser database system is known as concurrency control. The objective of concurrency control is to ensure the serializability of transactions in a multiuser database environment.
Lost update
The lost update problem occurs when two concurrent transactions are updating the same data element and one of the updates is lost (overwritten by the other transaction).
Uncommitted data
The phenomenon of uncommitted data occurs when two transactions are executed concurrently and the first transaction is rolled back after the second transaction has already accessed the uncommitted data - thus violating the isolation property of transactions.
Inconsistent retrievals
Inconsistent retrievals occur when a transaction accesses data before and after one or more other transactions finish working with such data. E.g. an inconsistent retrieval would occur if transaction T1 calculated some summary (aggregate) function over a set of data while another transaction (T2) was updating the same data. The problem is that the transaction might read some data before they are changed and other data after they are changed, thereby yielding inconsistent results.
Scheduler
The scheduler is a special DBMS process that establishes the order in which the operations are executed within concurrent transactions. The scheduler interleaves the execution of database operations to ensure serializability and isolation of transactions.
Serializable schedule
The scheduler’s main job is to create a serializable schedule of a transaction’s operations, in which the interleaved execution of the transactions yields the same results as if the transactions were executed in serial order one after another.
Lock
A lock guarantees exclusive use of a data item to a current transaction.
Pessimistic locking
The use of locks based on the assumption that conflict between transactions is likely is often referred to as pessimistic locking.
Lock manager
All lock information is handled by a lock manager, which is responsible for assigning and policing the locks used by the transactions.
Lock granularity
Lock granularity indicates the level of lock use. Locking can take place at the following levels: database, table, page, row, or even field (attribute).
Database-level lock
In a database-level lock, the entire database is locked, thus preventing the use of any tables in the database by transaction T2 while transaction T1 is being executed.
Table-level lock
In a table-level lock, the entire table is locked, preventing access to any row by transaction T2 while transaction T1 is using the table. If a transaction requires access to several table, each table may be locked.
Page-level lock
In a page-level lock, the DBMS locks an entire diskpage. A diskpage, or page, is the equivalent of a diskblock, which can be described as a directly addressable section of a disk.
Row-level lock
A row-level lock is much less restrictive than the locks previously discussed. The DBMS allows concurrent transactions to access different rows of the same table even when the rows are located on the same page. Although the row-level locking approach improves the availability of data, its management requires high overhead because a lock exists for each row in a table of the database involved in a conflicting transaction.
Field-level lock
The field-level lock allows concurrent transactions to access the same row as long as they require the use of different fields (attributes) within that row.