Where does the @Transactional annotation belong?

Technology CommunityCategory: SpringWhere does the @Transactional annotation belong?
VietMX Staff asked 3 years ago

Transactions belong on the Service layer. It’s the one that knows about units of work and use cases. It’s the right answer if you have several DAOs injected into a Service that needs to work together in a single transaction.