First, there is a check to see that the book is in stock, then the customer's account is debited, next the stock is decremented and the customer's account is updated to indicate that the book has been purchased, and finally the book is dispatched. I have indicated these actions with numbered arrows. The ordering system involves a business rules machine with components that are the conceptual stock, customer and dispatcher objects, and a database machine that makes the data persistent. Fictitious book ordering This is a fairly simple system, so let's see what happens if there is a failure. This means that any error that occurs in any of the methods should be propagated to all the other components involved, and more importantly to the databases to undo the previous actions.
Transactions are a distributed error-handling mechanism.
Transactions and threading Let's put this into the perspective of threading. Since all the actions within the transaction occur atomically, all succeeding or all failing, there must only ever be one thread of execution during the transaction. MTS manages this thread using activities. No intermediate results are accessible by other threads. However, the transaction requires that there is just one logical thread of execution.