Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam 2V0-72.22 topic 1 question 8 discussion

Actual exam question from VMware's 2V0-72.22
Question #: 8
Topic #: 1
[All 2V0-72.22 Questions]

Refer to the exhibit.

Assume that the application is using Spring transaction management which uses Spring AOP internally.
Choose the statement that describes what is happening when the update1 method is called? (Choose the best answer.)

  • A. There are 2 transactions because REQUIRES_NEW always runs in a new transaction.
  • B. An exception is thrown as another transaction cannot be started within an existing transaction.
  • C. There is only one transaction because REQUIRES_NEW will use an active transaction if one already exists.
  • D. There is only one transaction initiated by update1() because the call to update2() does not go through the proxy.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
2211094
1 week ago
A is correct
upvoted 1 times
...
Ancient1
11 months ago
Selected Answer: D
Answer is D. Based on the lecture video from Vmware's training course (Spring framework essentials> Module 9 > Configure Transaction Propagation): The first update method will create a transaction and run in a proxy, and when the second update method is called, it will be executed within the same transaction in the same proxy.
upvoted 4 times
Ancient1
11 months ago
Now you might be asking, why would it execute within the same transaction if the propagation is REQUIRES_NEW? Wouldn't it create a new transaction? Normally yes, however, In this case, the update2() method is being called in the same class as the first update(), making it an internal call. When the first update method was called the @Transactional annotation passed the method execution to the interceptor, which created a proxy for the transaction (Spring AOP). When the Internal call to the second update2() method was executed, it couldn't be intercepted by a new interceptor, therefore, it couldn't create its own transactional proxy, which means it cannot create a new transaction. If you don't understand this concept right away, don't worry. I had to review the video several times and I'm still trying to wrap my head around it.
upvoted 1 times
Azuni
10 months, 3 weeks ago
Same here. Luckily the instructor in the video did mention this and illustrated this in his slides 3:42 minutes into the video. Took me a while to filter though all the stuff.
upvoted 1 times
...
...
...
Azuni
11 months, 1 week ago
Selected Answer: A
The answer should be A. There should be two transactions. The first one will be suspended when the second one is called and once the second transaction is done, the first one will become active again. Please refer to the Spring Docs on the topic of Transaction propagation: https://docs.spring.io/spring-framework/reference/data-access/transaction/declarative/tx-propagation.html
upvoted 1 times
Azuni
11 months, 1 week ago
UPDATE: I went though the VMWare Spring Framework Essentials lecture video where they used this exact example. The answer is indeed D. Feel to stupid for my original post. Apologies for the confusion.
upvoted 3 times
...
...
Verixas
1 year, 2 months ago
The option D is correct due to this article, where this case resolved - https://www.marcobehler.com/guides/spring-transaction-management-transactional-in-depth
upvoted 2 times
...
rhuanca
1 year, 3 months ago
I think is A correct answer Option B is incorrect because an exception is not thrown when using REQUIRES_NEW propagation. Option C is incorrect because REQUIRES_NEW will always create a new transaction even if an active transaction is present. Option D is also incorrect because the call to update2() does go through the proxy and the transactional behavior will be applied.
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
ex Want to SAVE BIG on Certification Exam Prep?
close
ex Unlock All Exams with ExamTopics Pro 75% Off
  • arrow Choose From 1000+ Exams
  • arrow Access to 10 Exams per Month
  • arrow PDF Format Available
  • arrow Inline Discussions
  • arrow No Captcha/Robot Checks
Limited Time Offer
Ends in