DOC PREVIEW
UT Dallas CS 6360 - Ch21

This preview shows page 1-2-3-4-25-26-27-51-52-53-54 out of 54 pages.

Save
View full document
Premium Document
Do you want full access? Go Premium and unlock all 54 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Chapter 21 Introduction to Transaction Processing Concepts and Theory Copyright 2011 Pearson Education Inc Publishing as Pearson Addison Wesley 1 Introduction to Transaction Processing 1 Single User System At most one user at a time can use the system Multiuser System Many users can access the system concurrently Copyright 2011 Ramez Elmasri and Shamkant Navathe Introduction to Transaction Processing 2 A Transaction A transaction set of operations may be stand alone specified in a high level language like SQL submitted interactively or may be embedded within a program Transaction boundaries Logical unit of database processing that includes one or more access operations read retrieval write insert or update delete Begin and End transaction An application program may contain several transactions separated by the Begin and End transaction boundaries Copyright 2011 Ramez Elmasri and Shamkant Navathe Introduction to Transaction Processing 3 SIMPLE MODEL OF A DATABASE for purposes of discussing transactions A database is a collection of named data items Granularity size of the data item a field a record or a whole disk block Basic operations that a transaction can include are read and write read item X Reads a database item named X into a program variable To simplify our notation we assume that the program variable is also named X write item X Writes the value of program variable X into the database item named X Copyright 2011 Ramez Elmasri and Shamkant Navathe Introduction to Transaction Processing 4 READ AND WRITE OPERATIONS Basic unit of data transfer from the disk to the computer main memory is one block In general a data item what is read or written will be the field of some record in the database although it may be a larger unit such as a record or even a whole block read item X command includes the following steps Find the address of the disk block that contains item X Copy that disk block into a buffer in main memory if that disk block is not already in some main memory buffer Copy item X from the buffer to the program variable named X Copyright 2011 Ramez Elmasri and Shamkant Navathe Introduction to Transaction Processing 5 READ AND WRITE OPERATIONS cont write item X command includes the following steps Find the address of the disk block that contains item X Copy that disk block into a buffer in main memory if that disk block is not already in some main memory buffer Copy item X from the program variable named X into its correct location in the buffer Store the updated block from the buffer back to disk either immediately or at some later point in time Copyright 2011 Ramez Elmasri and Shamkant Navathe Two Sample Transactions Copyright 2011 Ramez Elmasri and Shamkant Navathe Introduction to Transaction Processing 6 Why Concurrency Control is needed The Lost Update Problem The Temporary Update or Dirty Read Problem This occurs when two transactions that access the same database items have their operations interleaved in a way that makes the value of some database item incorrect This occurs when one transaction updates a database item and then the transaction fails for some reason see Section 21 1 4 The updated item is accessed by another transaction before it is changed back to its original value The Incorrect Summary Problem If one transaction is calculating an aggregate summary function on a number of records while other transactions are updating some of these records the aggregate function may calculate some values before they are updated and others after they are updated Copyright 2011 Ramez Elmasri and Shamkant Navathe Concurrent execution is uncontrolled a The lost update problem Copyright 2011 Ramez Elmasri and Shamkant Navathe Concurrent execution is uncontrolled b The temporary update problem Copyright 2011 Ramez Elmasri and Shamkant Navathe Concurrent execution is uncontrolled c The incorrect summary problem Copyright 2011 Ramez Elmasri and Shamkant Navathe Introduction to Transaction Processing 12 Why recovery is needed What causes a Transaction to fail 1 A computer failure system crash A hardware or software error occurs in the computer system during transaction execution If the hardware crashes the contents of the computer s internal memory may be lost 2 A transaction or system error Some operation in the transaction may cause it to fail such as integer overflow or division by zero Transaction failure may also occur because of erroneous parameter values or because of a logical programming error In addition the user may interrupt the transaction during its execution Copyright 2011 Ramez Elmasri and Shamkant Navathe Introduction to Transaction Processing 13 Why recovery is needed cont What causes a Transaction to fail 3 Local errors or exception conditions detected by the transaction Certain conditions necessitate cancellation of the transaction For example data for the transaction may not be found A condition such as insufficient account balance in a banking database may cause a transaction such as a fund withdrawal from that account to be canceled A programmed abort in the transaction causes it to fail 4 Concurrency control enforcement The concurrency control method may decide to abort the transaction to be restarted later because it violates serializability or because several transactions are in a state of deadlock see Chapter 22 Copyright 2011 Ramez Elmasri and Shamkant Navathe Introduction to Transaction Processing 14 Why recovery is needed cont What causes a Transaction to fail 5 Disk failure Some disk blocks may lose their data because of a read or write malfunction or because of a disk read write head crash This may happen during a read or a write operation of the transaction 6 Physical problems and catastrophes This refers to an endless list of problems that includes power or air conditioning failure fire theft sabotage overwriting disks or tapes by mistake and mounting of a wrong tape by the operator Copyright 2011 Ramez Elmasri and Shamkant Navathe 2 Transaction and System Concepts 1 A transaction is an atomic unit of work that is either completed in its entirety or not done at all For recovery purposes the system needs to keep track of when the transaction starts terminates and commits or aborts Copyright 2011 Ramez Elmasri and Shamkant Navathe Transaction and System Concepts 2 Recovery manager keeps track of the following operations begin transaction This marks the beginning of transaction execution read or write These specify read or write operations


View Full Document

UT Dallas CS 6360 - Ch21

Documents in this Course
Ch22(1)

Ch22(1)

44 pages

Ch21

Ch21

38 pages

Ch19

Ch19

46 pages

Ch18

Ch18

25 pages

Ch17

Ch17

21 pages

Ch15

Ch15

42 pages

Ch09

Ch09

42 pages

Ch05

Ch05

34 pages

Ch22

Ch22

45 pages

Ch21

Ch21

38 pages

Ch19

Ch19

48 pages

Ch18

Ch18

24 pages

Ch17

Ch17

22 pages

Ch16

Ch16

17 pages

Ch15

Ch15

42 pages

Ch09

Ch09

42 pages

Ch08

Ch08

39 pages

Ch07

Ch07

34 pages

Ch06

Ch06

43 pages

Ch05

Ch05

34 pages

Ch04

Ch04

39 pages

Ch03(2)

Ch03(2)

36 pages

Ch02

Ch02

33 pages

Ch08

Ch08

28 pages

Ch07

Ch07

31 pages

Ch06

Ch06

43 pages

Ch05

Ch05

39 pages

Ch04(1)

Ch04(1)

39 pages

Ch03(1)

Ch03(1)

38 pages

Ch02

Ch02

38 pages

Ch01

Ch01

36 pages

Ch24

Ch24

36 pages

Ch21

Ch21

54 pages

Ch19

Ch19

48 pages

Ch18

Ch18

24 pages

Ch17

Ch17

22 pages

Ch03(1)

Ch03(1)

38 pages

Ch02

Ch02

38 pages

Ch01

Ch01

36 pages

Ch24

Ch24

36 pages

Ch21

Ch21

54 pages

Ch19

Ch19

48 pages

Ch18

Ch18

24 pages

Ch17

Ch17

22 pages

Ch08

Ch08

28 pages

Ch07

Ch07

31 pages

Ch06

Ch06

43 pages

Ch05

Ch05

39 pages

Ch04(1)

Ch04(1)

39 pages

Ch08

Ch08

39 pages

Ch07

Ch07

40 pages

Ch06

Ch06

47 pages

Ch05

Ch05

41 pages

Ch04

Ch04

43 pages

Ch03

Ch03

41 pages

Ch02

Ch02

38 pages

Ch01

Ch01

36 pages

Ch21

Ch21

54 pages

Ch19

Ch19

51 pages

Ch18

Ch18

24 pages

Ch08

Ch08

39 pages

Ch07

Ch07

40 pages

Ch06

Ch06

47 pages

Ch05

Ch05

41 pages

Ch04

Ch04

43 pages

Ch03

Ch03

41 pages

Ch02

Ch02

38 pages

Ch01

Ch01

36 pages

Ch21

Ch21

54 pages

Ch19

Ch19

51 pages

Ch18

Ch18

24 pages

Ch17

Ch17

25 pages

lab-manual

lab-manual

215 pages

Ch08

Ch08

39 pages

Ch07

Ch07

40 pages

Ch06

Ch06

47 pages

Ch05

Ch05

41 pages

Ch04

Ch04

43 pages

Ch03

Ch03

41 pages

Ch02

Ch02

38 pages

Ch01

Ch01

36 pages

Ch21

Ch21

54 pages

Ch19

Ch19

51 pages

Ch17

Ch17

25 pages

Ch21

Ch21

54 pages

Ch19

Ch19

51 pages

Ch18

Ch18

24 pages

Ch17

Ch17

25 pages

Ch08

Ch08

39 pages

Ch07

Ch07

40 pages

Ch06

Ch06

47 pages

Ch05

Ch05

41 pages

Ch04

Ch04

43 pages

Ch03

Ch03

41 pages

Ch02

Ch02

38 pages

Ch01

Ch01

36 pages

Ch04(1)

Ch04(1)

43 pages

Ch07

Ch07

40 pages

Ch03

Ch03

42 pages

Ch01

Ch01

36 pages

Ch02

Ch02

38 pages

Ch05

Ch05

41 pages

Ch06

Ch06

47 pages

Ch08

Ch08

39 pages

Ch17

Ch17

25 pages

Ch18

Ch18

24 pages

Ch09

Ch09

42 pages

Ch19

Ch19

51 pages

Ch21

Ch21

54 pages

Ch19

Ch19

51 pages

Ch18

Ch18

24 pages

Ch17

Ch17

25 pages

Ch09

Ch09

42 pages

Ch08

Ch08

39 pages

Ch07

Ch07

40 pages

Ch06

Ch06

47 pages

Ch05

Ch05

41 pages

Ch04(1)

Ch04(1)

43 pages

Ch03

Ch03

42 pages

Ch02

Ch02

38 pages

Ch01

Ch01

36 pages

Load more
Download Ch21
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Ch21 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Ch21 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?