System errors during dispatch processing
If unexpected system errors occur during business event dispatch processing, processed and in-progress events are automatically removed from the dispatch queue to prevent events from being processed multiple times or causing repeated errors. For problem determination or to retry event processing, you can use the optional error queue and event error program to save in-progress events that were potentially involved in the system error.
Transaction scopes in dispatch processing
Business event dispatch ECBs process events within transaction scopes to ensure that events are not lost if an unexpected error occurs. In addition, dispatch ECBs can process multiple events within a single transaction scope to provide more efficient dispatch processing.
Under normal circumstances, including detectable error conditions, business event processing periodically closes the active transaction scope, which finalizes the removal of any processed events from the dispatch queue. After closing the transaction scope, business event processing opens a new transaction scope and continues processing events from the dispatch queue.
System error handling in dispatch ECBs
- Nested transaction scopes that were created by IBM or by user-written custom event programs are rolled back. If any nested transaction scopes were suspended before the system error, those transaction scopes are resumed and then rolled back.
- If an event was being processed when the system error occurred, that event is processed by
standard business event error handling as follows:
- The optional event error program is called if it is defined in the event specification for this event.
- If an optional error queue is defined for this event and the optional event error program does not discard the event, the event is placed on the error queue.
- If the system error occurred while processing a dispatch adapter for an event, the dispatch adapter might be undeployed if error thresholds are reached.
- The transaction scope is closed, which finalizes all processed and in-progress events for this business event dispatch ECB.
Although business event system error handling is called for many types of system errors, it is not called in all cases. When business event system error handling is not called, the z/TPF system rolls back the transaction scope and any processed and in-progress events are placed back on the dispatch queue. As a result, those events might be transmitted multiple times or repeated errors might occur when the in-progress event is reprocessed.
Business event system error handling is registered with system error processing by using the tpf_systemerror_atexit function. For more information about when registered functions are not called by system error processing, see the programming considerations in the tpf_systemerror_atexit function information.
