I am developing a billing application. The billing engine code (implemented on the service bean level) performs several insert and update statements on physical tables when the user runs billing.
I want to make sure that all these transactions are either committed or roll-backed together. I am using CommitContext and passing the entity names accordingly (please check attached file showing one example method used in the billing generation engine).
This is working fine so far, however, there are some flags that I need to update when the work is done, and these updates have to be part of the same commit context. The “addInstanceToCommit” method only adds new instances to the passed entity. What is the best way to include update statements in the commit context?
Many thanks for your usual support.