Podcast
Questions and Answers
What happens if a machine crashes between subtracting money from a savings account and adding it to a checking account?
What happens if a machine crashes between subtracting money from a savings account and adding it to a checking account?
- The transaction is rolled back
- The money is lost (correct)
- The customer gets extra money
- The account is frozen
Why is it necessary to perform addition to checking first in a transaction?
Why is it necessary to perform addition to checking first in a transaction?
- To prevent the customer from losing money
- To avoid errors in the transaction
- To ensure the bank doesn't lose money (correct)
- To speed up the transaction
What is the state of a transaction when it starts its operation?
What is the state of a transaction when it starts its operation?
- Committed
- Partially committed
- Aborted
- Active (correct)
What is a transaction in the context of database systems?
What is a transaction in the context of database systems?
What can cause a transaction to fail?
What can cause a transaction to fail?
What happens when a transaction is rolled back?
What happens when a transaction is rolled back?
What is the state of a transaction when it is successfully completed?
What is the state of a transaction when it is successfully completed?
What can cause a disk failure during a transaction?
What can cause a disk failure during a transaction?
A transaction processing must ensure that the database is in a consistent state after its execution. What property of a transaction ensures this?
A transaction processing must ensure that the database is in a consistent state after its execution. What property of a transaction ensures this?
What is the purpose of the read_item(X) operation?
What is the purpose of the read_item(X) operation?
What is the minimum number of database access operations in a transaction?
What is the minimum number of database access operations in a transaction?
What happens to the database if a transaction is aborted?
What happens to the database if a transaction is aborted?
What is the purpose of the write_item(X) operation?
What is the purpose of the write_item(X) operation?
What is the benefit of atomicity in transaction processing?
What is the benefit of atomicity in transaction processing?
What is an example of a transaction in a banking system?
What is an example of a transaction in a banking system?
What are the basic operations on a database?
What are the basic operations on a database?
Flashcards are hidden until you start studying
Study Notes
Transaction Processing
- A transaction is a logical unit of work that includes one or more database access operations, such as retrieval, insertion, deletion, and modification.
Characteristics of a Transaction
- A transaction must be either completed or aborted.
- A transaction is a program unit whose execution may change the contents of a database.
- To ensure the integrity of the database, a transaction must be atomic (also called serialisability).
Atomic Transaction
- An atomic transaction is a transaction in which either all actions associated with the transaction are executed to completion or none are performed.
Basic Operations on Database
- Read and write are the basic operations on a database.
read_item(X)
reads a database item named X into a program variable.write_item(X)
writes the value of program variable X into the database item named X.
Example of a Transaction
- A customer transfers Rs. 1000 from savings to a checking account using an ATM.
- The transaction requires two steps: subtracting the money from the savings account balance and adding the money to the checking account balance.
Reasons for a Transaction to Fail
- Computer failure: hardware, software, or network error occurs in the computer system during transaction execution.
- Transaction or system error: an operation in the transaction may cause it to fail, such as integer overflow or division by 0.
- Local errors or exception conditions: certain conditions may occur during transaction execution, such as insufficient account balance.
- Concurrency control enforcement: a transaction may be aborted due to a deadlock.
- Disk failure: disk blocks may lose their data due to a disk read/write head crash.
- Physical problems and catastrophes: fire, theft, etc.
States of a Transaction
- Active state: after the transaction starts its operation.
- Partially committed: when the last state is reached.
- Aborted: after the transaction has been rolled back and the database has been restored to its state prior to the start of the transaction.
- Committed: after successful completion of the transaction.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.