Define Isolation.- Isolation ensures one transaction does not interfere with another.
- Isolation helps when there are concurrent transactions.
- In order to set the isolation level for a JDBC transaction, we can use Connection.setTransaction(int level) method.
- There are five levels of transaction isolation which are as follows:
- A special constant that JDBC driver does not support transactions.
- Allows looking after the uncommitted changes to the database.
- The transactions are externally invisible until the transaction is committed.
- The dirty reads prevention is possible with this level.
- The readable rows retain locks by which another transaction can not change them until the transaction completes.
- It disallows dirty reads and non repeatable reads.
- The tables are locked for the transaction which makes the WHERE conditions not to be changed by other transactions.
- This process prevents all database anomalies.