1. Trang chủ
  2. » Công Nghệ Thông Tin

Distributed Database Management Systems: Lecture 26

29 1 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 29
Dung lượng 82,29 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Distributed Database Management Systems: Lecture 26. The main topics covered in this chapter include: transaction management with basics and properties of transaction; database consistency; a transaction is a logical unit of work; consistent transaction;...

Trang 1

Distributed Database Management Systems

Lecture 26

Trang 2

In this Lecture

• Transaction Management

–Basics

–Properties of Transaction

Trang 3

• Database consistency

• A transaction is a

logical unit of work

• Consistent transaction.

Trang 4

Consistent State

Execution of Transaction T

End of Transaction T

Trang 5

Transaction

Management is

difficult in case of the concurrent access to the database by

multiple users.

Trang 7

A transaction is

considered to be a

sequence of read or/and write operations; it may even consist of a single statement

Trang 8

Transaction Example T-SQL

Transaction BUDGET_UPDATE

begin

EXEC SQL UPDATE J SET BUDGET = BUDGET * 1.1 WHERE JNAME = “CAD/CAM" end

Trang 9

Example Database

Airline Reservation System– FLIGHT(fNo, fDate, fSrc, fDest,

stSold, fCap)

– CUST(cName, cAddr, cBal)

– FC(fNo, fDate, cName, cSpecial)

Trang 10

Begin_transaction Reservation

EXEC SQL Select stSold, cap into temp1, temp2

where fNo = flight_no and date = dt

output("no free seats"); Abort else

EXEC SQL update flight

EXEC SQL insert into FC values (flight_no,

dt, c_Name, null); Commit;

output("reservation completed")

end

Trang 12

- Read and Write are

major operations of DB concern in a transaction

- Read set (RS): The set

of data items that are

read by a transaction

Trang 13

- Write set (WS): The set of

data items whose values

are changed by this

transaction

- Base set (BS) = RS U WS

- RS and WS need not to be

mutually exclusive

Trang 14

• Above Characterizations

are simple since they do

not consider insert and

delete, so concern more a static DB

• Dynamic Trs have to deal

with Phantoms

Trang 15

Let O ij(x) be some operation

Trang 18

Conflicting Operations

Two operations Oi(x) and

Oj(x) are said to be in

conflict, Oi = write or Oj = write (at least one of them

is write and they access

the same data item)

Trang 21

ACID Properties of a

Transaction

Trang 22

1- Atomicity: also known

as “all or none” property

–refers to the atomicity of

entire Tr rather than an

individual operation

–It requires from system to

define some action in case of any interruption in execution

of Tr.

Trang 23

–Two types of failures requiring

procedures from Transaction

Recovery or Crash Recovery

2- Consistency: refers simply

to the correctness of a

transaction

–A Transaction should transform

the DB from one consistent

state to another consistent

state.

Trang 24

by a Transaction before its commitment.

Trang 25

• Degree 3 Consistency

1- T does not overwrite dirty data of other Transaction

2- T does not commit any writes until

it completes all its writes (i.e., until end of Transaction)

3- T does not read dirty data from

other Transaction

4- Other Transaction do not dirty any data read by T before T commits

Trang 26

3- Isolation

- A Transaction cannot reveal its

results to other Transaction

before commitment

- Required in particular when

one of the Transaction is

updating a common data item

Trang 27

- Consider two Trs T1 and T2

Trang 29

Thanks

Ngày đăng: 05/07/2022, 13:39

TÀI LIỆU CÙNG NGƯỜI DÙNG

  • Đang cập nhật ...

TÀI LIỆU LIÊN QUAN