On the beginning and the end of Oracle transaction

Source: Internet
Author: User
Tags exit commit rollback

A transaction is a logical unit of work that divides the activities of a database, and a transaction has a starting point and an end point.

The transaction begins when one of the following events occurs:

Connects to the database and executes the first-day DML statement, and a second DML statement is entered after the current transaction ends;

The transaction ends when one of the following events occurs:

Executes a commit or ROLLBACK statement, executes a DLL statement, such as a CREATE TABLE statement, in which case a commit statement is executed automatically, and a DCL statement, such as a grant statement, is executed, in which case the commit statement is executed automatically; The connection to the database. When you exit Sql*plus, the Exit command is typically entered, and the commit statement is executed automatically. If the Sql*plus is terminated unexpectedly (for example, a computer running Sql*plus crashes), the rollback statement is executed automatically, a DML statement is executed, and the statement fails, and in this case the rollback is executed for the invalid DML statement;

Note: After a transaction completes, it is considered bad programming practice to commit or rollback a transaction without displaying it, so make sure that a commit or ROLLBACK statement is executed after each transaction.

This column more highlights: http://www.bianceng.cnhttp://www.bianceng.cn/database/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.