
- DBMS Tutorial
- DBMS - Home
- DBMS - Overview
- DBMS - Architecture
- DBMS - Data Models
- DBMS - Data Schemas
- DBMS - Data Independence
- Entity Relationship Model
- DBMS - ER Model Basic Concepts
- DBMS - ER Diagram Representation
- DBMS - Generalization, Aggregation
- Relational Model
- DBMS - Codd's Rules
- DBMS - Relational Data Model
- DBMS - Relational Algebra
- DBMS - ER to Relational Model
- DBMS- SQL Overview
- Relational Database Design
- DBMS - Database Normalization
- DBMS - Database Joins
- Storage and File Structure
- DBMS - Storage System
- DBMS - File Structure
- Indexing and Hashing
- DBMS - Indexing
- DBMS - Hashing
- Transaction And Concurrency
- DBMS - Transaction
- DBMS - Concurrency Control
- DBMS - Deadlock
- Backup and Recovery
- DBMS - Data Backup
- DBMS - Data Recovery
- DBMS Useful Resources
- DBMS - Quick Guide
- DBMS - Useful Resources
- DBMS - Discussion
Explain about concurrent transactions in DBMS
A transaction is a unit of database processing which contains a set of operations. For example, deposit of money, balance enquiry, reservation of tickets etc.
Every transaction starts with delimiters begin transaction and terminates with end transaction delimiters. The set of operations within these two delimiters constitute one transaction.
main() { begin transaction } end transaction
There are three possible ways in which a transaction can be executed. These are as follows −
- Serial execution.
- Parallel execution.
- Concurrent execution.
Concurrent transaction or execution includes multiple transactions which are executed concurrently or simultaneously in the system.
Advantages
The advantages of the concurrent transactions are as follows −
Increases throughput which is nothing but number of transactions completed per unit time.
It reduces the waiting time.
Example
T1= 90sec T2= 500sec T3= 5sec.
If we execute serially by T1->T2->T3 then transaction T3 waits for 590 sec, so we go for non-serial or concurrent transactions to reduce waiting time.
i.e. T3 -> T1 -> T2.
Disadvantage
The disadvantage is that the execution of concurrent transactions may result in inconsistency.
Example 1
The concurrent execution given below is in a consistent state.
Example 2
The transaction given below is not consistent.
Concurrent schedules do not keep the database in the consistent state. The concurrent execution of the transactions has to be carried out in a controlled environment.
If a system consists of ‘n’ number of transactions, we will have more than ‘n!’ number of concurrent schedules, out of which only a few of them are keeping the database in consistent state.
- Related Articles
- Explain about nested queries in DBMS
- Explain about conflict serializability in DBMS
- Explain about 2NF with an example in DBMS
- Explain about triggers and active databases in DBMS
- Explain about the Time stamp ordering protocol in DBMS
- Explain about insert command in Structured query language in DBMS
- Explain about two phase locking (2PL) protocol(DBMS)
- Explain about Create, Insert, Select command in structure query language (DBMS)?
- Explain Select command in DBMS
- Explain set operators in DBMS
- Explain join dependency in DBMS
- Explain the logical operators in DBMS
- Explain closure of attributes in DBMS
- Explain the Network Model in DBMS?
- Explain the Relational Model in DBMS?
