Transaction Management




Often, several operations on the database form a single logical unit of work. An
example is a funds transfer, in which one department account
(say A) is debited and another department account (say B) is credited. Clearly, it
is essential that either both the credit and debit occur, or that neither occur. That
is, the funds transfer must happen in its entirety or not at all. This all-or-none
requirement is called atomicity. In addition, it is essential that the execution of the
funds transfer preserve the consistency of the database. That is, the value of the
sum of the balances of Aand B must be preserved. This correctness requirement
is called consistency. Finally, after the successful execution of a funds transfer,
the new values of the balances of accounts A and B must persist, despite the
possibility of system failure. This persistence requirement is called durability.


A transaction is a collection of operations that performs a single logical
function in a database application. Each transaction is a unit of both atomicity
and consistency. Thus, we require that transactions do not violate any databaseconsistency
constraints. That is, if the database was consistent when a transaction
started, the database must be consistent when the transaction successfully terminates.
However, during the execution of a transaction, it may be necessary
temporarily to allow inconsistency, since either the debit of A or the credit of B
must be done before the other. This temporary inconsistency, although necessary,
may lead to difficulty if a failure occurs.


It is the programmer’s responsibility to define properly the various transactions,
so that each preserves the consistency of the database. For example, the
transaction to transfer funds from the account of department A to the account of
department B could be defined to be composed of two separate programs: one
that debits account A, and another that credits account B. The execution of these
two programs one after the otherwill indeed preserve consistency.However, each
program by itself does not transform the database from a consistent state to a new
consistent state. Thus, those programs are not transactions.


Ensuring the atomicity and durability properties is the responsibility of the
database system itself—specifically, of the recovery manager. In the absence of
failures, all transactions complete successfully, and atomicity is achieved easily.
However, because of various types of failure, a transaction may not always complete
its execution successfully. If we are to ensure the atomicity property, a failed
transaction must have no effect on the state of the database. Thus, the database
must be restored to the state in which it was before the transaction in question
started executing. The database system must therefore perform failure recovery,
that is, detect system failures and restore the database to the state that existed
prior to the occurrence of the failure.


Finally, when several transactions update the database concurrently, the consistency
of data may no longer be preserved, even though each individual transaction
is correct. It is the responsibility of the concurrency-control manager to control
the interaction among the concurrent transactions, to ensure the consistency
of the database. The transaction manager consists of the concurrency-control
manager and the recovery manager.

The concept of a transaction has been applied broadly in database systems
and applications. While the initial use of transactions was in financial applications,
the concept is now used in real-time applications in telecommunication, as
well as in the management of long-duration activities such as product design or
administrative workflows.


 



Frequently Asked Questions

+
Ans: A database system is partitioned into modules that deal with each of the responsibilities of the overall system. The functional components of a database system can be broadly divided into the storage manager and the query processor components. view more..
+
Ans: A relational database is based on the relational model and uses a collection of tables to represent both data and the relationships among those data. view more..
+
Ans: A relational database is based on the relational model and uses a collection of tables to represent both data and the relationships among those data. view more..
+
Ans: A transaction is a collection of operations that performs a single logical function in a database application. view more..
+
Ans: The architecture of a database system is greatly influenced by the underlying computer system on which the database system runs. Database systems can be centralized, or client-server, where one server machine executes work on behalf of multiple client machines. view more..
+
Ans: The term data mining refers loosely to the process of semi-automatically analysing large databases to find useful patterns. view more..
+
Ans: Researchers have developed several data-models to deal with these application domains, including object-based data models and semi-structured data models. view more..
+
Ans: A primary goal of a database system is to retrieve information from and store new information into the database. People who work with a database can be categorized as database users or database administrators. view more..
+
Ans: Information processing drives the growth of computers, as it has from the earliest days of commercial computers. In fact, automation of data processing tasks predates computers. view more..
+
Ans: A relational database consists of a collection of tables, each of which is assigned a unique name. view more..
+
Ans: The database schema is the logical design of the database. view more..
+
Ans: A super-key is a set of one or more attributes that, taken collectively, allow us to identify uniquely a tuple in the relation. view more..
+
Ans: DBMS typically includes a database security and authorization subsystem that is responsible for ensuring the security of portions of a database against unauthorized access view more..
+
Ans: The typical method of enforcing discretionary access control in a database system is based on the granting and revoking of privileges. Let us consider privileges in the context of a relational DBMS. view more..
+
Ans: This chapter discusses techniques for securing databases against a variety of threats. It also presents schemes of providing access privileges to authorized users. view more..
+
Ans: This chapter discusses techniques for securing databases against a variety of threats. It also presents schemes of providing access privileges to authorized users. view more..
+
Ans: Object databases is the power they give the designer to specify both the structure of complex objects and the operations that can be applied to these objects view more..
+
Ans: XML (Extensible Markup Language)—has emerged as the standard for structuring and exchanging data over the Web. XML can be used to provide information about the structure and meaning of the data in the Web pages rather than just specifying how the Web pages are formatted for display on the screen view more..




Rating - 3/5
503 views

Advertisements