ASP transaction Processing

Source: Internet
Author: User
In the database, the so-called transaction refers to a set of logical operations units that transform data from one state to another. In order to ensure the consistency of data in the database, the data should be manipulated with discrete groups of logical units, so that the data consistency can be maintained when the data is completed, and when a part of the operation fails, the entire transaction is ignored and all operations after the starting point are returned to the starting state. Three ways to implement ASP processing: Method One Using the Connection object in the ASP built-in ADO component, we can implement the transactional processing of database operations Connection.begintrans method: Start a transaction Connection.committrans method: Complete/ Commit Transaction Connection.rollbacktrans method: Undo/Discard Transaction method Two can take advantage of the transaction processing mechanism inside the database system, and complete the transaction processing of data operation by writing the stored procedure containing the transaction in the database server. At the same time, using the ADO component to invoke the stored procedure, you can also determine whether the transaction execution succeeds based on the return code of the stored procedure in the database system, each SQL statement is a transaction. Therefore, each statement is guaranteed to be completed or returned to the beginning. However, if you want the operation of a set of SQL statements to either complete or all invalid, you need to use the transaction mechanism of the database to implement. Method three when implementing transaction processing using the transaction mechanism of the MTS (Microsoft Transaction Server) component, it is important to note that transactions under this mechanism cannot span multiple ASP pages, and if a transaction requires objects from multiple components, You must combine the operations of these objects in an ASP page

  

ASP transaction Processing

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.