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

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;...

Distributed Database Management Systems Lecture 26 In this Lecture • Transaction Management –Basics –Properties of Transaction • Database consistency • A transaction is a logical unit of work • Consistent transaction Consistent State of DB Begin Transaction T May be Temporarily Inconsistent Execution of Transaction T Consistent State End of Transaction T Transaction Management is difficult in case of the concurrent access to the database by multiple users Multiple read-only transactions cause no problem at all, however, if one or more of concurrent transactions try to update data, that may cause problem A transaction is considered to be a sequence of read or/and write operations; it may even consist of a single statement Transaction Example T-SQL Transaction BUDGET_UPDATE begin EXEC SQL UPDATE J SET BUDGET = BUDGET * 1.1 WHERE JNAME = “CAD/CAM" end Example Database Airline Reservation System – FLIGHT(fNo, fDate, fSrc, fDest, stSold, fCap) – CUST(cName, cAddr, cBal) – FC(fNo, fDate, cName, cSpecial) Begin_transaction Reservation input(flight_no, dt, c_name); EXEC SQL Select stSold, cap into temp1, temp2 where fNo = flight_no and date = dt if temp1 = temp2 then output("no free seats"); Abort else EXEC SQL update flight set stSold = stSold + where fNo = flight_no and date = dt; EXEC SQL insert into FC values (flight_no, dt, c_Name, null); Commit; output("reservation completed") end Let Oij(x) be some operation Oj of transaction Ti operating on data item x, where Oj ∈ {read,write} and Oj is atomic Set of operations of Transaction Ti, OSi = Uj Oij • Ni ∈{abort,commit} • Transaction Ti is a partial order Ti = {∑i,

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