concurrency control (transactions) for Oracle

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.