Example of a Local Transaction

The following is an example of how a business procedure is designed so that all the steps are either committed or not committed using the local resource manager.

In a banking environment you want to make sure that all the accounts are updated correctly, so that the balances are totaled. The ideal scenario is where all the processes are committed in one go so that money is deducted from one account and added to another. For example, if money is to be transferred from a savings account to a current account, both accounts must be updated and changed. Both accounts need to be updated accordingly instead of only one account was updated.

If the update to the savings account was successful but the update to the current account failed, there would be a discrepancy in the total amount. However, because the step is part of the local transaction, the whole transaction will fail and the accounts are rolled back to their original state.