The Java Transaction API (JTA) is the element responsible for providing the API responsible for ensuring the consistency of your data in the widest sense. In our quote manager, it is only applied to the database data but it can be applied to JMS messages, potentially files if you use connectors, and so on.
Without going through the details and protocol, the idea is to ensure, across multiple systems, that either all commits or all rollbacks but not something in between are done ensuring the consistency of the system (which is one common issue mixing NoSQL systems).
To do that, JTA uses what we call a two phases commit protocol:
- Ask all systems to prepare the commit which means the system must verify and ensure it will be able to commit in next phase
- Ask all systems to actually do the commit
A lot of transaction manager or servers are optimized for the...