Do I need to annotate my Service methods as @Transactional to make sure that the connections opened by the Repository layer is closed? What if I don't annotate as @Transactional? Will this lead to open connections\inactive sessions?
Asked
Active
Viewed 33 times
0
-
Possible duplicate of [Spring - @Transactional - What happens in background?](http://stackoverflow.com/questions/1099025/spring-transactional-what-happens-in-background) – diziaq Dec 21 '15 at 06:17
-
4No. You need to annotate them as Transactional to make sure that everything done inside the method happens in a single, atomic, consistent, isolated, durable, transaction. – JB Nizet Dec 21 '15 at 07:04
-
1Connection handling is done within the connection pool, not in the transaction. – Uwe Allner Dec 21 '15 at 10:20