9.2. Transaction Isolation Levels

The degree to which the results of one transaction are visible to other transactions is known as the transaction isolation level. You can set the isolation level on a per-transaction basis. The following four levels are defined in the SQL standard:

SERIALIZABLE

This is the default specified by the SQL standard. Dirty reads, non-repeatable reads, and phantom reads are not permitted in this isolation level. SERIALIZABLE is the most "strict" of the isolation levels.

REPEATABLE READ

Dirty reads and non-repeatable reads are not permitted, but phantom reads are permitted. This isolation level is not supported by Oracle.

READ COMMITTED

This is the default used by Oracle. Dirty reads are not permitted, but non-repeatable reads and phantom reads are permitted.

READ UNCOMMITTED

Dirty reads, non-repeatable reads, and phantom reads are permitted. This isolation level is not supported by Oracle.

Oracle's default isolation level of READ COMMITTED is acceptable for most programs. Your other choice is SERIALIZABLE, but you should use it only if you have an extremely good reason, as it may slow the performance of your SQL statements. You may change the transaction isolation level using the SQL SET TRANSACTION statement.

Get Java Programming with Oracle SQLJ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.