Understand middleware event transaction control
- Last UpdatedOct 23, 2024
- 1 minute read
If pre- and/or post-hooks are configured, then the flow of the middleware event (i.e., whether to commit or rollback, stop or continue with the flow) is controlled by the Middleware Flow parameter [see Understand the pre-hook and post-hook Middleware Flow property for more information]. If an exception is raised from the pre- or post-hooks or from the middleware event itself, and Middleware Flow is set to Stop on Error, then the current transaction is rolled back, including the transactions from pre- and post-hooks. The end user is responsible for determining when to raise an error from the stored procedure/assembly and for controlling the flow of the middleware event.
The stored procedures/assemblies involved for the pre- and post-hooks are executed as a part of the middleware transaction that corresponds to the middleware event. In general, the stored procedures/assemblies involved for the pre- and post-hooks are executed as a part of the middleware transaction that corresponds to the middleware event. The total transaction time allotted for the middleware event is split among the pre-hook, middleware event, and the post-hook. However, if the Middleware Flow parameter is set to Continue Even on Error, then each event (i.e. pre-hook, normal middleware event, post-hook) is executed in a separate transaction. In this case, the transaction time‑out that is configured applies to each transaction.