I like using the declarative model for defining transactions. Just like the following line of code.
<Transactional(TransactionalTypes.TransactionScope)>
It appears to me that it depends on throwing an error in the object to rollback the transaction. For instance I have an object hierarchy that is several levels deep. If the child object xx fails it must throw the exception to rollback the transaction.
My problem is that I am trying to define an execution state object to determine successfull completion of transaction across all objects so that in a large project we don't have to rewrite the handling of specific exceptions like the database going down. So, we are not throwing errors, we are setting an execution state that is implemented in most of our objects and the controller is using that object to determine whether to send out emails, etc.
Given this scenario, how can I trigger the transaction to rollback if I don't throw errors since I only trap them and set appropriate information in the execution state object?
Has anyone come accross this issue or a similiar issue?
Copyright (c) Marimer LLC