Transaction Management

Transaction Management:

  • A transaction is said to be as execution of the User Program in the DBMS.

  • A Transaction can be defined as collection of operations that form into a single logical unit of work.

  • The transaction is the execution of a program that access or changes the contents of the database.

  • Example: Transferring of funds from one account to another account is a Transaction.

Properties of Transaction:

  • Every transaction will have 4 properties.

  1. Atomicity: This property ensures a transaction is an atomic unit of processing. That is the transaction is either perform completely or not perform at all.

  2. Consistency: A correct execution of a transaction must take the database from one consistent state to another consistent state.

  3. Isolation: A transaction should not make its updates visible to other transactions until it is committed.

  4. Durability: Once the transaction changes the database and the changes are committed, these changes must never be lost because of sub sequent failures

Database System Structure:

  • 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.

  • The storage manager is important because databases typically require a large amount of storage space. Some Big organizations Database ranges from giga bytes to tera bytes. So the main memory of computers cannot store this much information, the information is stored on disks. Data are moved between disk storage and main memory as needed.

  • The query processor also very important because it helps the database system simplify and facilitate access to data. So quick processing of updates and queries is important. It is the job of the database system to translate updates and queries written in a nonprocedural language, at the logical level, into an efficient sequence of operations at the physical level.

Storage Manager:

  • A storage manager is a program module that provides the interface between the low- level data stored in the database and the application programs and queries submitted to the system. The storage manager is responsible for the interaction with the file manager. The storage manager translates the various DML statements into low-level file-system commands. Thus, the storage manager is responsible for storing, retrieving, and updating data in the database.

Storage Manager Components:

  1. Authorization and integrity manager: which tests for the satisfaction of integrity constraints and checks the authority of users to access data.

  2. Transaction manager: which ensures that the databasef remains in a consistent (correct) state despite system failures, and that concurrent transaction executions proceed without conflicting.

  3. File manager: which manages the allocation of space on disk storage and the data structures used to represent information stored on disk.

  4. Buffer manager: which is responsible for fetching data from disk storage into main memory. The storage manager implements several data structures as part of the physical system implementation. Data files are used to store the database itself. Data dictionary is used to stores metadata about the structure of the database, in particular the schema of the database.

Query Processor:

  • Query Processor Components:

  1. DDL interpreter: It interprets DDL statements and records the definitions in the data dictionary.

  2. DML compiler: It translates DML statements in a query language into an evaluation plan consisting of low-level instructions that the query evaluation engine understands.

  3. Query evaluation engine: It executes low-level instructions generated by the DML compiler.