Session – 11 CONCURRENCY CONTROL USER ACCESS CONTROL Matakuliah: M0184 / Pengolahan Data...

10
Session – 11 CONCURRENCY CONTROL USER ACCESS CONTROL Matakuliah : M0184 / Pengolahan Data Distribusi Tahun : 2005 Versi :

description

TRANSACTION The concept of a transaction is used within the database domain as a basic unit of consistent and reliable computing A database in consistent state if it obey all of consistency (integrity) constraint defined over it Transaction consistency refers to the action of concurrent transaction. The module responsible for concurrency control in DBMS known as a scheduler, since its job is to schedule transactions correctly to avoid interference

Transcript of Session – 11 CONCURRENCY CONTROL USER ACCESS CONTROL Matakuliah: M0184 / Pengolahan Data...

Page 1: Session – 11 CONCURRENCY CONTROL USER ACCESS CONTROL Matakuliah: M0184 / Pengolahan Data Distribusi Tahun: 2005 Versi:

Session – 11

CONCURRENCY CONTROL

USER ACCESS CONTROL

Matakuliah : M0184 / Pengolahan Data DistribusiTahun : 2005Versi :

Page 2: Session – 11 CONCURRENCY CONTROL USER ACCESS CONTROL Matakuliah: M0184 / Pengolahan Data Distribusi Tahun: 2005 Versi:

OBJECTIVE

• Basic Transaction Concept• Transaction as the basic unit of work in

DBMS• Transaction Types

Page 3: Session – 11 CONCURRENCY CONTROL USER ACCESS CONTROL Matakuliah: M0184 / Pengolahan Data Distribusi Tahun: 2005 Versi:

TRANSACTION

• The concept of a transaction is used within the database domain as a basic unit of consistent and reliable computing

• A database in consistent state if it obey all of consistency (integrity) constraint defined over it

• Transaction consistency refers to the action of concurrent transaction.

• The module responsible for concurrency control in DBMS known as a scheduler, since its job is to schedule transactions correctly to avoid interference

Page 4: Session – 11 CONCURRENCY CONTROL USER ACCESS CONTROL Matakuliah: M0184 / Pengolahan Data Distribusi Tahun: 2005 Versi:

Transaction Model

Begin transaction T

End transaction TExecution of

transaction T

DB in consistent state

DB in consistent state

DB may temporarily in an inconsistent way during execution

Page 5: Session – 11 CONCURRENCY CONTROL USER ACCESS CONTROL Matakuliah: M0184 / Pengolahan Data Distribusi Tahun: 2005 Versi:

Four basic properties of transaction

• Atomicity, the “all or nothing” property; a transaction is an indivisible unit

• Consistency, transaction transform the DB from one consistent state to another consistent state

• Independence, transaction execute independently of one another

• Durability, the effects of a successfully completed transaction are permanently recorded in the DB and can not be undone

Page 6: Session – 11 CONCURRENCY CONTROL USER ACCESS CONTROL Matakuliah: M0184 / Pengolahan Data Distribusi Tahun: 2005 Versi:

Transaction in Application Program

• The execution of an application program in a database environment can be viewed as a series of atomic transaction with non-database process taking place in between

Page 7: Session – 11 CONCURRENCY CONTROL USER ACCESS CONTROL Matakuliah: M0184 / Pengolahan Data Distribusi Tahun: 2005 Versi:

Transaction in Application Program

ProgramStart

Program End

Time

TransactionT1

TransactionT2

TransactionT3

Non-Database

Page 8: Session – 11 CONCURRENCY CONTROL USER ACCESS CONTROL Matakuliah: M0184 / Pengolahan Data Distribusi Tahun: 2005 Versi:

Distributed Transaction

• Transaction may access data stored at more than one site

• Each transaction is divided into a number of sub-transactions

Page 9: Session – 11 CONCURRENCY CONTROL USER ACCESS CONTROL Matakuliah: M0184 / Pengolahan Data Distribusi Tahun: 2005 Versi:

Distributed Transaction Example

Begin transaction T1Begin Transaction T1(A)

read balance(x)balance(x) = balance(x) – 100if balance(x) < - then

print “No Fund”abort T1(A)

end ifwrite balance(x)

commit T1(A)

Page 10: Session – 11 CONCURRENCY CONTROL USER ACCESS CONTROL Matakuliah: M0184 / Pengolahan Data Distribusi Tahun: 2005 Versi:

Distributed Transaction Example

Begin Transaction T1(B)read balance(y)balance(y) = balance(y) + 100write balance(y)

commit T1(B)Commit T1