READ COMMITTED isolation
When you use the isolation level READ COMMITTED
, a SELECT
query obtains a backup of committed data at the transaction's start. Subsequent queries during the current transaction also see the results of uncommitted updates that already executed in the same transaction.
When you use DML statements, your query acquires write locks to prevent other READ COMMITTED
transactions from modifying the same data. However, be aware that SELECT
statements do not acquire locks, so concurrent transactions can obtain read and write access to the same selection.
READ COMMITTED
is the default isolation level. For most queries, this isolation level balances database consistency and concurrency. However, this isolation level can allow one transaction to change the data that another transaction is in the process of accessing. Such changes can yield nonrepeatable and phantom reads. You may have applications with complex queries and updates that require a more consistent view of the database. If so, use SERIALIZABLE isolation instead.
The following figure shows how READ COMMITTED
isolation might control how concurrent transactions read and write the same data:
READ COMMITTED
isolation maintains exclusive write locks until a transaction ends, as shown in the following graphic: