Today, the editor will share with you how to use Transaction in the database. Interested friends will learn about it with the editor!
In the actual operation of ASP, this always happens, such as transferring money from my account to Fei Wenhua's account in the bank.
My account shows that it has been marked out, but due to a failure of the bank's system, the database change of Fei Wenhua's account failed.
How should this be handled? There should be no loss in my account amount, right?
Of course, your interests are not lost, and the changed account database information will be automatically restored.
What is used here is the interactive function (TRANSACTION), which is composed of IIS and MTS (Mircrosoft Transaction Server)
Completed together. Its function is: it is considered successful when all database changes in the ASP program are successful; if one of them is
If the database changes fail, other database records that have been changed will be automatically restored.
Both SQL SERVER and ORACLE databases provide interactive functionality, but ACCESS does not.
This interactive function acts within the scope of an ASP program, that is, all databases involving this program have interactive functions.
The method is to add:
TRANSACTION=Required
To tell IIS this program to use interactive functions, specific ASP programs:
...
Sub OnTransactionCommit()
...
End Sub
Sub OnTransactionAbort()
...
End Sub
% >
The above is an introduction to how to use Transaction in the database. I hope you can like it. For more content, please continue to pay attention to the website of the Wrong New Technology Channel!