13.07.2015 Views

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

476 Locking in the DB2 Under UNIX and PC Hosts Interface 4 Chapter 15READ_ISOLATION_LEVEL= RR | RS | CS | URThe DB2 database manager supports the RR, RS, CS, and UR isolation levels thatare defined in the following table. Regardless of the isolation level, the databasemanager places exclusive locks on every row that is inserted, updated, or deleted.All isolation levels there<strong>for</strong>e ensure that only this application process can changeany given row during a unit of work—no other application process can change anyrows until the unit of work is complete.Table 15.3Isolation Levels <strong>for</strong> DB2 Under UNIX and PC HostsIsolation LevelRR (Repeatable Read)RS (Read Stability)CS (Cursor Stability)UR (Uncommitted Read)Definitionno dirty reads, no nonrepeatable reads, no phantom readsno dirty reads, no nonrepeatable reads; does allow phantom readsno dirty reads; does allow nonrepeatable reads and phantomreadsallows dirty reads, nonrepeatable reads, and phantom readsHere is how the terms in the table are defined.Dirty readsA transaction that exhibits this phenomenon has very minimalisolation from concurrent transactions. In fact, it can seechanges that those concurrent transactions made even be<strong>for</strong>ethey commit them.For example, suppose that transaction T1 per<strong>for</strong>ms anupdate on a row, transaction T2 then retrieves that row, andtransaction T1 then terminates with rollback. Transaction T2has then seen a row that no longer exists.NonrepeatablereadsIf a transaction exhibits this phenomenon, it is possible that itmight read a row once and, if it attempts to read that rowagain later in the course of the same transaction, anotherconcurrent transaction might have changed or even deleted therow. There<strong>for</strong>e, the read is not (necessarily) repeatable.For example, suppose that transaction T1 retrieves a row,transaction T2 then updates that row, and transaction T1 thenretrieves the same row again. Transaction T1 has now retrievedthe same row twice but has seen two different values <strong>for</strong> it.Phantom readsWhen a transaction exhibits this phenomenon, a set of rowsthat it reads once might be a different set of rows if thetransaction attempts to read them again.For example, suppose that transaction T1 retrieves the set ofall rows that satisfy some condition. Suppose that transactionT2 then inserts a new row that satisfies that same condition. Iftransaction T1 now repeats its retrieval request, it sees a rowthat did not previously exist (a “phantom”).UPDATE_ISOLATION_LEVEL= CS | RS | RRThe DB2 database manager supports the CS, RS, and RR isolation levels definedin the preceding table. Uncommitted reads are not allowed with this option.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!