1, the acid characteristics of the transaction: atomicity atomicity, consistency consistency, isolation isolation, durability persistence.
2, the operation of the transaction
① Transaction Commit sql>commit; ② Transaction Rollback sql>rollback; ③ Save point Sql>savepoint save name; Rollback to save the roll call;
Note: I. A transaction that has already been committed cannot be rolled back. II. A transaction that rolls back to a reservation will undo all modifications after the retention point.
④set Transaction statement: Used to set various properties of a transaction.
The ① property has an isolation layer that specifies the transaction ② the storage space used when the transaction is rolled back ③ the named transaction
3. End Transaction
The following conditions Oracle considers a transaction to end:
①commit
②rollback
③ Execute DDL statement (Create, Drop, Alter), transaction is committed
④ disconnecting from Oracle, transaction is committed
⑤ user process is terminated unexpectedly, transaction is rolled back
Simply put, commit and rollback are two ways to end, except that the commit and rollback situations are different.
4. Isolation LEVEL
Through some phenomena, the isolation level effect can be reflected. These phenomena are: ① update lost ② dirty read ③ non-repeatable read ④ illusion
|
Dirty Read |
Non-REPEATABLE READ |
Illusion |
Read not submitted |
Yes |
Yes |
Yes |
Read commit (default) |
No |
Yes |
Yes |
Repeat Read |
No |
No |
Yes |
Serialization of |
No |
No |
No |
5. Setting the isolation Level
In Oracle, you can set the isolation level of a transaction in the following ways before the transaction begins:
SET transation Isolation Level READ COMMITTED; (Oracle default transaction isolation Levels)
SET transation Isolation Level SERIALIZABLE;
SET transation READ only;
You can set the isolation level for an entire session in a separate session:
ALTER SESSION SET Isolation_lebel SERIALIZABLE;
ALTER SESSION SET Isolation_lebel READ commited;
ALTER SESSION SET Isolation_lebel READ only;
concurrency control (transactions) for Oracle