Private Messages in Batch Transactions
When batch transactions are used, all data access requests are initially stored by the CMI Protocol engine. Later, if a private processes used to trigger a batch, it sends a separate special request to either execute or to the cancel the batch. Another way to trigger a batch is through a message queue log from a Log Viewer.
For more in formation, see Batch Transactions.
When you use private processes for batch transactions, the following happen:
1. | A Private Process sends an INITIATOR.REQUEST message to CMI Protocol. |
2. | After performing a message validation, CMI Protocol stores the data in database tables and send back an INITIATOR.RESPONSE message indicating that the batch request has been received, but that it has not yet been executed. |
If the request is not valid, such as if it failed to pass the message validation, CMI Protocol sends an ERROR
message and an INITIATOR.RESPONSE
message that includes the error code and details.
3. | The Private process now sends a special INITIATOR.REQUEST message to CMI Protocol. The operation type of this message is batch and the action type is either execute or cancel . |
— | If the request is valid (the batch is available to execute or cancel), CMI Protocol sends an INITIATOR.RESPONSE message for the special request, indicating that it starts to execute or cancel the request. |
— | If the request is not valid (such as when the batch does not exist or has been executed), an ERROR message is sent. In addition, an INITIATOR.RESPONSE message is sent that includes the error code and details. |
4. | Regardless of where the batch was triggered (from the GUI or from the Private process), the following messages indicate results: |
— | Execute Request: CMI Protocol starts to iterate stored requests and execute them. |
Upon successful execution of each single request, no message is sent. However upon failure, an ERROR
message is sent and execution continues to the next request. No INITIATOR.RESPONSE
message is sent, since it was already sent upon receiving the request.
Once all requests have been executed, an ADVISORY
message is sent that includes a descriptive summary information, such as how many requests succeeded, how many request failed, when the batch started to execute, and when the execution was completed.
— | Cancel Request: CMI Protocol starts to delete all stored requests. |
Since the Cancel
action for any single request could never fail, no ERROR
or INITIATOR.RESPONSE
messages is sent. An ERROR
messages is sent only to indicate fatal errors, such as when the database connection failed. In a case of a fatal error, an ERROR
message is sent and processing is stopped.
A Cancel request is invalid for a batch that is currently being executed.
Once cancellation is completed, an ADVISORY
message is sent indicating success of cancellation.