S90-08 practice question 23 of 35

Which of the following statements accurately describes the difference between the Atomic Service Transaction pattern and the Compensating Service Transaction pattern?

Full set: 100 questions
Answer options
A: The Atomic Service Transaction pattern is more suitable in situations that require real-time activity processing, whereas the Compensating Service Transaction pattern is more suitable for long-running activity processing.
B: The Atomic Service Transaction pattern provides support for the rollback of changes, whereas the Compensating Service Transaction pattern does not.
C: The Atomic Service Transaction pattern does not rely on pre-defined alternative exception handling logic, whereas the Compensating Service Transaction pattern does.
D: All of the above. Correct answer
Correct Answer:
D. All of the above.
Explanation

The Atomic Service Transaction pattern leverages traditional ACID (Atomicity, Consistency, Isolation, Durability) transactions, which are suitable for short-lived, real-time processes where resources can be locked. This pattern relies on the underlying transaction coordinator to automatically roll back all changes if any part of the operation fails. Conversely, the Compensating Service Transaction pattern is designed for long-running business activities where holding resource locks is impractical. It does not use a traditional rollback. Instead, if a failure occurs after some steps have already committed, it executes pre-defined, custom "compensating" logic to semantically undo the completed steps. Therefore, all three statements accurately describe key differences between the patterns.

Why Incorrect

A: This statement is correct but incomplete. It only addresses the difference in suitable processing duration, which is just one of several key distinctions. B: This statement is correct but incomplete. It focuses solely on the rollback mechanism, omitting other critical differences like activity duration and logic implementation. C: This statement is correct but incomplete. It highlights the difference in exception handling logic without mentioning the underlying reasons related to transaction duration and type.

References

1. Erl, T. (2009). SOA Design Patterns. Prentice Hall.

Atomic Service Transaction Pattern (p. 463): "This pattern is generally applied to business processes that are short-lived... It relies on a transaction protocol and a coordinator that can enforce the all-or-nothing outcome of an atomic transaction." This supports options A and B.

Compensating Service Transaction Pattern (p. 471): "A pattern that allows a series of service operations to be processed as a single unit of work... while avoiding the need to lock resources for the entire duration of the business activity." This supports option A.

Compensating Service Transaction Pattern (p. 472): "The logic required to reverse the effects of a previously completed operation is encapsulated in a special-purpose operation referred to as a compensation... This is different from a simple rollback in that the reversal logic is explicitly defined and designed." This supports options B and C.

Scroll to Top