2V0-72.22PSE · Question #29
Which statement describes the propagation behavior of Propagation.REQUIRES_NEW annotation? (Choose the best answer.)
The correct answer is C. Starts a new transaction; if an active transaction already exists, it is suspended. Propagation.REQUIRES_NEW always starts a brand new transaction, and if a transaction is already active, it gets suspended (paused) until the new one completes - making C correct. Why the distractors are wrong: A describes Propagation.NEVER (or similar behavior) - REQUIRES_NEW…
Question
Which statement describes the propagation behavior of Propagation.REQUIRES_NEW annotation? (Choose the best answer.)
Options
- AStarts a new transaction but throws an exception if an active transaction already exists.
- BJoins a transaction if one already exists; throws an exception if an active transaction does not
- CStarts a new transaction; if an active transaction already exists, it is suspended.
- DRuns in a nested transaction if an active transaction exists; throws an exception if an active
How the community answered
(36 responses)- A3% (1)
- B3% (1)
- C94% (34)
Explanation
Propagation.REQUIRES_NEW always starts a brand new transaction, and if a transaction is already active, it gets suspended (paused) until the new one completes - making C correct.
Why the distractors are wrong:
- A describes
Propagation.NEVER(or similar behavior) -REQUIRES_NEWnever throws an exception just because an existing transaction is present; it simply suspends it. - B describes
Propagation.MANDATORY, which requires an existing transaction and throws if none exists. - D describes
Propagation.NESTED, which creates a savepoint inside an existing transaction rather than a fully independent one.
Memory tip: Think of REQUIRES_NEW as "I work alone" - it always gets its own transaction, pushing any existing one aside until it's done, with no sharing or exceptions thrown based on existing state.
Topics
Community Discussion
No community discussion yet for this question.