Exception handling and consistency of data
If the statement or stored procedure raises an error, a ConfirmBOD is created. This ConfirmBOD must include the exception message. To raise an error, you can for example use this code:
RAISERROR ('Customer ' + @customerId + ' does not exist',10, 1)
A ConfirmBOD is also created if the database throws an exception or the transaction cannot be committed successfully.
Transaction management
The database transaction is managed by the ION Service. Therefore, delivery is guaranteed. An incoming message is removed from the queue in the same transaction that commits the changes to the database.
When reading the database, the ION Service also manages the transaction. The statement to read the database may perform inserts or updates, for example to keep track of the timestamp when reading.