Name
SetComplete —
ObjectContext.SetComplete
Synopsis
Signals the successful completion of a transaction. When it is called, the code in the OnTransactionCommit event procedure code is processed if it exists.
A call to the SetComplete method from within the script itself only indicates the success of the script on the page. It does not override possible failure of the code within the components referenced in the script. All transactional components in the script must signal SetComplete for the transaction to commit.
Parameters
None
Example
See the example in the previous section, "SetAbort."
Notes
Note that calling SetComplete does not necessarily mean that the entire transaction is complete. Every component called from the script also must call the SetComplete method of the ObjectContext object.
If you do not explicitly call SetComplete, the transaction is complete only after all code is processed without any calls to SetAbort. If no call to SetAbort is made by the end of the script, the OnTransactionCommit event procedure code is processed if it exists, regardless of whether SetComplete is called.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access