Ctrl K
Java · Senior · Theory

How does the @Transactional annotation work in Spring? Tell me about situations where a transaction behaves differently from what the developer expects.

~4 min by voice

How to approach it

This checks whether you understand how Transactional works inside, the AOP proxy, binding the transaction to the thread, the rollback rules and propagation, and whether you can derive the typical bugs from that mechanism instead of just listing them from memory.

Have you seen this question in a real interview?
Answers0
Avg. score—
Strong—
Practiced0
Topics
Similar questionsВозьмём перевод между двумя счетами, которые лежат в одной базе: списать с одного, зачислить на другой. Как вы это реализуете, чтобы при параллельных операциях деньги не потерялись и баланс не ушёл в минус? SeniorA Spring Boot service needs to accept report generation tasks, each of which takes several minutes. How would you organize running them inside the Java application? Mid-levelHow do you organize exception handling in a Spring application: where do you catch exceptions, and when do you use checked versus unchecked exceptions? Mid-levelHow does the @Transactional annotation work in Spring? JuniorWhat anomalies occur with concurrent transactions, and how do isolation levels protect against them? Give an example where Read Committed would let you down. Senior

Answer by voice

The interviewer will ask this question and listen. Think out loud and ask for a hint if you need one. When you're done, pause or tap “That's my answer”. In about a minute, your score and the points you covered show up here.

Sign in to answer

Best with headphones · ~4 min