PRAGMA AUTONOMOUS_TRANSACTION autonomous transaction Application

Source: Internet
Author: User

The PRAGMA AUTONOMOUS_TRANSACTION autonomous transaction application can define one or several autonomous transactions in one of your transactions (outer transactions. An autonomous transaction can be committed independently without affecting the outer transaction. Similarly, the rollback of the outer transaction does not affect the autonomous transaction. Generally, you can consider defining an autonomous transaction as a process that is called in an outer transaction. That is, the current stored procedure runs as a sub-transaction of an existing transaction. The commit and rollback operations of the sub-transaction do not affect the state of the parent transaction applied to (1) Anonymous blocks (2) triggers (3) example of a stored PROCEDURE: PROCEDURE addrowautonomous (pid IN tlog. id % TYPE, pldate IN tlog. ldate % TYPE, plhsecs IN tlog. lhsecs % TYPE, pllevel IN tlog. llevel % TYPE, plsection IN tlog. lsection % TYPE, pluser IN tlog. luser % TYPE, pltexte IN tlog. ltexte % TYPE) is pragma AUTONOMOUS_TRANSACTION; BEGIN addrow (pid => pid, pldate => pldate, plhsecs => plhsecs, pllevel => pllevel, plsection => plsection, pluser => pluser, pltexte => pltexte); COMMIT; exception when others then plog. error; ROLLBACK; RAISE; END; autonomous transactions can be used to record debugging information in the custom program PROCEDURE insert_cux_debug_info (........) is pragma AUTONOMOUS_TRANSACTION ;........ begin insert into cux_debug_info VALUES ........; COMMIT; END;

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.