Configuring isolation levels

If a connection does not specify its isolation level, it inherits the default isolation level for the Derby system. The default value is CS.

When set to CS, the connection inherits the TRANSACTION_READ_COMMITTED isolation level. When set to RR, the connection inherits the TRANSACTION_SERIALIZABLE isolation level, when set to RS, the connection inherits the TRANSACTION_REPEATABLE_READ isolation level, and when set to UR, the connection inherits the TRANSACTION_READ_UNCOMMITTED isolation level.

To override the inherited default, use the methods of java.sql.Connection.

In addition, a connection can change the isolation level of the transaction within an SQL statement. For more information, see "SET ISOLATION statement" in the Derby Reference Manual. You can use the WITH clause to change the isolation level for the current statement only, not the transaction. For information about the"WITH clause," see the "SELECT statement"in the Derby Reference Manual.

In all cases except when you change the isolation level using the WITH clause, changing the isolation level commits the current transaction.

Note: For information about how to choose a particular isolation level, see Tuning Derby.
Related concepts
Isolation levels and concurrency
Lock granularity
Types and scope of locks in Derby systems
Deadlocks