CS60 Chapter 13 Transaction management and concurrency control.pdf

CS60 Chapter 13 Transaction management and concurrency control.pdf

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 13 Transaction management and concurrency control Page 271 8/18/2017 Chapter 13. Transaction management and concurrency control Contents Introduction ............................................................................................................................................................... 271 Transaction properties ............................................................................................................................................... 274 Transaction management by the person writing SQL statements .............................................................................. 274 The transaction log is a system table ......................................................................................................................... 275 Possible problems in a multi-user database system ................................................................................................... 276 Lost updates ........................................................................................................................................................... 276 Uncommitted data .................................................................................................................................................. 277 Inconsistent retrievals ............................................................................................................................................ 278 The scheduler ............................................................................................................................................................. 279 Concurrency control with locks ................................................................................................................................. 279 Binary and shared/exclusive locks ............................................................................................................................. 281 Two-phase locking insures serializability .................................................................................................................. 282 Deadlocks (deadly embraces) and their prevention, detection, and avoidance .......................................................... 283 Concurrency control with time stamping ................................................................................................................... 284 Concurrency control with optimistic methods ........................................................................................................... 284 Backup ....................................................................................................................................................................... 285 Types of failures ........................................................................................................................................................ 286 Recovery Management .............................................................................................................................................. 286 Immediate writes and deferred writes ........................................................................................................................ 287 Key Terms ................................................................................................................................................................. 287 Introduction A single-user DBMS allows, at mo st, one user to access the database system at a time, and a multi-user DBMS allows more than one user to access the system at a time. If a computer system includes multiple CPUs, then that computer system can execute multiple instructions simultaneously (at the same time), and that computer system is capable of multi-processing or parallel processing . However, if the computer system has only one CPU, some operating systems allow that CPU to be shared between different tasks or several users in the same time frame (a period of time lasting perhaps a tiny fraction of a second or whatever). Instructions for multiple users are not executed simultaneously, but rather, in that time frame, instructions are interleaved . Instructions for one user are executed, then instructions for another user are executed, then instructions for a third user are executed (or maybe instructions for the first user again). This type of processing is called concurrent processing or multi- programming , a type of processing described in this chapter. Ultimately, the disk operations are either a read or a write . A SELECT statement would read data from secondary storage (e.g., the hard drive) where the database is permanently stored. Other statements such as INSERT, DELETE, and UPDATE both read and write. While an INSERT doesn't have any old row of
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon