Name

OnTransactionCommit — OnTransactionCommit( )

Synopsis

The OnTransactionCommit event procedure is processed immediately if the SetComplete method of the ObjectContext object is called explicitly in scripted code or by a server component called from the scripted code. It also is called implicitly if no script on the current page called the SetAbort method.

Parameters

None

Example

<% 

' The following code procedure is processed when the code in 
' the SetComplete method example is processed.
Sub OnTransactionCommit ( )
%>
   Your book sales transaction was completed.
   Thank you for your sale.

<%
   Session("intTotalSales") = Session("intTotalSales") + 1

   ' Process any nontransactional code here...

End Sub

%>

Notes

The OnTransactionCommit event procedure can be used to inform the client of the success of the transaction. It also can be used for code that you want to be processed only if the transaction completes successfully.

Do not call the SetAbort or SetCommit methods from the OnTransactionCommit event procedure. Doing so may introduce a loop and result in the loss of function for your application and/or a loss of data.

Get ASP in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.