Chapter 06 Transactions

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

What is Transaction?

Process to be done in Database begin ………………………………. end

Transaction
Type: DML: need commit DDL, DCL: Auto commit
Begin: with first DML St. for each statement
End: Commit, Rollback after the execution of each statement
More than one statement in one transaction one statement in each transaction

Commit: writing commit command, normal exit


Rollback: writing rollback command, abnormal termination.

Status before commit, after commit


Status before rollback, after rollback
Transactions
Read
Consistency Database
Roll back Segment
Emp
Before Image of Data Table

Select * from emp; Update emp Update emp


Set sal = sal *1.3 Set sal = sal *1.2
Where empno = Where empno = 7788
7788
( Session 3 ) (Seesion 2) (Seesion 1)

( Reader Session ) (Waitting Session ) (Locking Session )

Writers must wait for writers


Readers don't wait for writers

You might also like