Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 11. Transactions > Isolation Levels

11.4. Isolation Levels

With some DBMSs, you can set the isolation level, which simply means the level of isolation between users of the database and their transactions and how much they are allowed to interfere with each other. To this point, this chapter has discussed transactions as if they were absolutely isolated from each other, but this may not be necessary or even desirable. Remember that transactions and locks have costs associated with them, and to force absolute isolation at all times would cause maximum cost. However, insufficient isolation between transactions can cause serious problems, displaying inconsistent views of the data and even causing data corruption. It is important to understand the issues that insufficient isolation can cause, as well as issues that unnecessary isolation causes.

11.4.1. SET TRANSACTION

The SQL2 standard provides an actual SET TRANSACTION statement that tells the DBMS which isolation level the transaction that follows uses. You can use this statement only as the first statement of a transaction, and thus you cannot change it in the middle of a transaction. It is possible to change levels at the beginning of any transaction, allowing different processes the freedom to select the isolation level necessary for the transaction that follows. Each level has its uses and should be used where applicable. After all, the lower the isolation level, the lower the impact on the database, on other users and processes, and on the hardware and software that implement the database platform.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint