• Like
Job Opportunity
Upcoming SlideShare
Loading in...5
×
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
45
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
0
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. TOPICS Covered = Designations in IT Companies ,Colleges ,MNC’s ,Govt. Sectors ,Business . Prepared By:- Sunny Saini Asst. Professor LKCW, Jalandhar City Email: sunnysaini090@gmail.com Website: www.techz.tk
  • 2. What is a Transaction? “A transaction is a smallest unit of program execution .” It is a set of changes that must all be made together . It is a program unit whose execution may or may not change the contents of the database.transaction is executed as a single unit. Transaction consists of definite number of steps:
  • 3. For Example A tranfer of money from one bank account to other bank account can be treated as transaction.
  • 4. Concept of a Transaction Saving Account Rs.5000 TO 3000 Loan Account Rs.5000 to 7000
  • 5. Transaction Properties There are four important properties of transaction that a DBMS must ensure to maintain data in the case of concurrent access and system failures. These are also called as ACID properties: A. Atomicity C. Consistency I. Isolation D. Durability
  • 6. Atomicity A transaction is said to be atomic if a transaction always executes all its actions in one step or donot execute any action at all.  Consistency A transaction must preserve the consistency of a database after the execution. Isolation The transaction must behave as if they are executed in isolation.it means that if several transactions are executed concurrently the results must be same as if they were executed serially in same order.
  • 7. Durability The effect of completed or committed transactions should persist even after a crash.it means once a transaction commits , the system must guarantee that the result of its operations will never be lost,inspite of subsequent failures.
  • 8. Transaction States Through out the life cycle of a transaction, the transaction must be in one of the following states: 1.Activethis is the initial state ,the transaction stays in this state while it is executing. 2.Partially CommittedA transaction is in the state when it has executed the final statement. 3.Failedwhen the normal execution can no longer preceed.
  • 9. 4.AbortedAfter the transaction has been rolled back and the database has been restored to its state prior to the start of the transaction. 5.CommittedAfter successful completion.
  • 10. Transaction States New Transaction Database Initial State ACTIVE PARTIALLY COMMITTE D COMMITTE D FAILED ABORTED Restored To Initial State
  • 11. CONCURRENCY AND CONCURRENCY CONTROL “Allowing multiple transactions to run concurrently on the same database is called Concurrency.” Feature of Concurrency is available due to the multi- programming features of operating systems.
  • 12. “Concurrency control is the process of regulating access to the same data by multiple transactions operating in the same database environment.” Consider what can happen if two or more concurrent users access the same data without any concurrency control.
  • 13. Advantages of Concurrency Control *Improved Throughputconsider that transaction are performed in serial order and active transaction is waiting for a page to be read in from disk ,then instead of CPU waiting for a page ,it can process another transaction. *Reduced Waiting TimeInterleaved execution of a short transaction with a long transaction Usually allows the short transaction to complete quickly.
  • 14. Disadvantages of Concurrency Control -Lost update Problem -The temporary Update (uncommited dependency)Problem -The incorrect Summary(inconsistent analysis)Problem
  • 15. Concurrency Control Schemes Concurrency control schemes are divided into two categories: Pessimistic or Conservative Approach Optimistic Approach