Isolation Levels

When applied to transactions, the term isolation level refers to how well one transaction is isolated from another. Oracle’s default transaction isolation level is read committed. You can get the current isolation level for a connection by using the Connection object’s getTransactionIsolation( ) method. You can set the transaction isolation level by calling the Connection object’s setTransactionIsolation( ) method and passing one of the two valid constants: TRANSACTION_READ_COMMITTED or TRANSACTION_SERIALIZABLE. Oracle’s read serializable isolation level will give you a consistent view of data from multiple tables since the last commit or rollback. Essentially, you see a snapshot of the tables as they existed when the transaction started. This is as opposed to read committed, which allows you to see changes during your transaction as soon as other transactions commit.

Get Java Programming with Oracle JDBC 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.