Explore Courses Blog Tutorials Interview Questions
0 votes
in Java by (3.9k points)
Should you place the @Transactional in the DAO classes and/or their methods or is it better to annotate the Service classes which are calling using the DAO objects? Or does it make sense to annotate both "layers"?

1 Answer

0 votes
by (46k points)

The transactions belong to the Service layer. It's the one that apprehends about units of work and use cases. It's the right case if you have several DAOs injected into a Service that needs to work together in a single transaction. It’s happening because of the Eclipse is to Java 1.5


Related questions

0 votes
1 answer
asked Jul 31, 2019 in Java by Anvi (10.2k points)
0 votes
1 answer
0 votes
1 answer
asked Aug 6, 2019 in Java by Krishna (2.6k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

30.5k questions

32.6k answers


108k users

Browse Categories