Setting the Transaction Isolation Level
Higher levels of transaction isolation offer the most protection for the
integrity of database data. Serializable transactions are guaranteed to be
unaffected by other transactions and therefore guaranteed to maintain database integrity.
However, a higher level of transaction isolation can cause slower performance
because it increases the chances that the application will have to wait for
locks on data to be released. An application may specify a lower level of
isolation to increase performance in the following cases:
For more information, see the
When it can be guaranteed that no other transactions exist that might
interfere with an application
When speed is more critical than accuracy and any errors are likely to be
small. For example, suppose that a company makes many small sales and that large
sales are rare. A transaction that estimates the total value of all open sales
might safely use the Read Uncommitted isolation level. Although the transaction
would include orders in the process of being opened or closed that are
subsequently rolled back, these would tend to cancel each other out and the transaction
would be much faster because it is not blocked each time it encounters such an
order.