hibernate - where to place Transactional Spring annotation , in which layer? -



hibernate - where to place Transactional Spring annotation , in which layer? -

i have uncertainty in placing spring annotation, in layer? these 2 cases:

case : placing @transactional in dao layer

case : placing @transactional in service layer?

i using spring only, not springmvc.

you want services @transactional. if daos transactional, , phone call different daos in each service, have multiple tansaction, not want. create service calls @transactional, , dao calls within methods participate in transaction method.

refer link more details

spring hibernate spring-mvc transactional

Comments

Popular posts from this blog

c - Compilation of a code: unkown type name string -

java - Bypassing "final local variable defined in an enclosing type" -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -