Oracle transaction
Transaction Description: a series of operations that constitute a single logical unit.
Transaction Features:
1. atomicity, that is, severability;
2. consistency to ensure data consistency with the business before and after data update;
Third, isolation, multiple transactions are unaffected;
4. Persistence. After the transaction is committed, the data will be permanently stored in the hybrid database.
Isolation level:
1. uncommitted read (read uncommitted): Dirty read, unrepeatable read, and phantom read will occur. Dirty read is designed to provide non-blocking read, but for Oracle, non-blocking read is provided by default,
That is, the query will not be affected by any addition, deletion, and modification operations, because Oracle provides undo to store the pre-update data.
2. Read committed: Non-repeated and Phantom reads may occur. The default transaction isolation level of oracle.
3. Repeatable read: phantom read occurs.
4. serializable: the highest isolation level. Dirty reads, non-repeated reads, and Phantom reads are not allowed. That is, one transaction can be executed only after another transaction is executed. Of course, concurrency is the worst.
In addition to these four types, Oracle also provides read-only isolation level, that is, only read is supported. At this level, the transaction can only see the modifications committed at the beginning of the transaction.
Dirty read, non-repeated read, phantom read meaning
Dirty read: one transaction can read data not committed by another transaction.
Repeatable read: different results may appear in queries of different time periods in a transaction and may be updated or deleted.
Phantom read: in a transaction, the number of records is different in different time periods. The difference with non-repeated reads is that in Phantom reads, the data already read will not change, but more data will meet the query conditions compared with the previous one.