Ctrl K
Java · Junior · Theory

How does the @Transactional annotation work in Spring?

~4 min by voice

How to approach it

This checks whether the candidate understands what a transaction is and how Spring implements it declaratively through a proxy. The practical gotchas matter most: self-invocation, rollback only on unchecked exceptions, private methods.

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-levelWhat is a database transaction, and what does the acronym ACID stand for? JuniorYou have a Spring Boot monolith that a team of thirty people has been developing for five years, and it's started slowing development down. How would you decide whether to split it into services or modularize it internally, and how would you carry out the changes? SeniorA method is annotated with @Transactional, but when an error occurs the data in the database isn't rolled back. What causes would you check? Mid-level

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