Você está na página 1de 15

Technical Seminar - 2004

CONCURRENT TRANSACTIONS

Presented By

Soumya Ranjan Biswal


Roll no-IT200118069

Under the guidance of


Mr. Anisur Rahman

1
Presented By:- Soumya Ranjan Biswal(IT200118069)
Technical Seminar - 2004

Introduction
• A transaction is a unit of program execution that accesses and possibly
updates various data items in a database system.

• The transactions are required to have the ACID properties: atomicity,


consistency, isolation, and durability.

• Transaction processing system usually allows both single as well as


multiple transactions to run.

• Concurrent execution of transactions improves throughput of transactions


& system utilization & also reduces the waiting time of transactions.

2
Presented By:- Soumya Ranjan Biswal(IT200118069)
Technical Seminar - 2004

Transaction Concepts

• A transaction has the following properties:


Atomicity: All operations of the transaction are reflected
properly in the database, or none are.
Consistency: Execution of transaction in isolation preserves the
consistency of the database.
Isolation: In this each transaction is unaware of other
transactions executing concurrently in the system.
Durability: After a transaction completes properly, the changes
it has made to the database is retained even if there
are system failures.

3
Presented By:- Soumya Ranjan Biswal(IT200118069)
Technical Seminar - 2004

Transaction State

• A transaction from the beginning to the end, must be in one of the


following states:
Active –Transaction stays here while executing.
Partially Committed - After the final statement has
been executed.
Failed – If normal execution can no longer proceed.
Aborted – Transaction has been rolled back &
database restored to its prior state.
Committed – Transaction is successful.

4
Presented By:- Soumya Ranjan Biswal(IT200118069)
Technical Seminar - 2004

Concurrent Execution

• Concurrent execution means running side by side or parallely


of transactions.
• Advantages of Concurrent execution are:
Improved throughput & Resource utilization – i.e. no.
of transactions executed increases in a given amount of
time & the processor is utilized properly.

Reduced Waiting time – The unpredictable delays in


running transactions as well as the average response time
is reduced.

5
Presented By:- Soumya Ranjan Biswal(IT200118069)
Technical Seminar - 2004

Serializability

• The transaction is a unit that preserves consistency, and serial


execution of transaction guarantees that consistency is preserved.
• A schedule in a transaction captures the key action of transaction
that affects concurrent execution such as read & write operation.
• So required is that any schedule produced by concurrent
processing set of transactions will have an effect equivalent to a
schedule produced when these transactions are run serially.
• A system that guarantees this property is said to ensure
serializability.

6
Presented By:- Soumya Ranjan Biswal(IT200118069)
Technical Seminar - 2004

• There are 2 types of serializability:


- Conflict serializability
- View serializability
• Serializability of schedules generated by concurrent transactions
can be ensured through concurrency control schemes.
• The schedules should have the following properties:
- they must be recoverable.
- they must be cascadeless.

7
Presented By:- Soumya Ranjan Biswal(IT200118069)
Technical Seminar - 2004

Transaction Definition in SQL

• It is a data manipulation language which specifies the set of


action that constitute a transaction.
• The SQL standard specifies that the transactions begin
explicitly.
• The transactions are ended by any one of the following SQL
statements:
- Commit work: commits the current transaction &
begins a new one.
- Rollback work: It aborts the current transaction.

8
Presented By:- Soumya Ranjan Biswal(IT200118069)
Technical Seminar - 2004

Concurrency control
• When transactions execute concurrently in the database , the
consistency of data may not be preserved . So in order to achieve
control , various Concurrency-control schemes are used.
• Concurrency-control schemes are also used to ensure
serializability. All these schemes either delay an operation or
abort the transaction that issued the operation.
• Most commonly used Concurrency-control schemes are:
-locking protocols
-timestamp based protocols

9
Presented By:- Soumya Ranjan Biswal(IT200118069)
Technical Seminar - 2004

Lock based protocols

• A locking protocol is a set of rules that state when a


transaction may lock and unlock each of the data items in the
database.
• Two-phase locking protocol: this protocol allows a
transaction to lock a new data item only if that transaction has
not yet unlocked any data item. This protocol ensures
serializability, but not deadlock freedom.
• Strict two-phase locking protocol: It permits release of
exclusive locks only at the end of transactions, in order to
ensure recoverability and cascadelessness of the resulting
schedules.

10
Presented By:- Soumya Ranjan Biswal(IT200118069)
Technical Seminar - 2004

Lock based protocols

• Rigorous two-phase locking protocol: This protocol releases


all locks only at the end of the transaction.

11
Presented By:- Soumya Ranjan Biswal(IT200118069)
Technical Seminar - 2004

Timestamp-based protocols

• A timestamp-based protocol ensures serializability by selecting


an ordering in advance between every pair of transactions.
• It works in the following manner:
-first a unique fixed timestamp is associated with each
transaction in the system .
-these timestamps of the transactions determine the
serializability order.
-if the timestamp of transaction Ti is smaller than the timestamp
of transaction Tm , then the scheme ensures that

12
Presented By:- Soumya Ranjan Biswal(IT200118069)
Technical Seminar - 2004

Timestamp-based protocols

the produced schedule is equivalent to a serial schedule in


which transaction Ti appears before transaction Tm.
• It does so by rolling back a transaction whenever such an order
is violated.

13
Presented By:- Soumya Ranjan Biswal(IT200118069)
Conclusion
• This topic describes about the various concepts of transaction
processing. About what it is and how it works. Furthermore it
also gives a good layout about the concepts of Concurrent
transactions. And also how Concurrent execution of
transactions improves throughput of transactions and system
utilization reduces waiting time of transactions etc.Also
present in the report are the various concurrency-control
schemes which ensure a smooth running of the Concurrent
transactions as well as the consistency of the database to be
preserved

14
Presented By:- Soumya Ranjan Biswal(IT200118069)
Technical Seminar - 2004

THANK YOU!!!

15
Presented By:- Soumya Ranjan Biswal(IT200118069)

Você também pode gostar