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

Delphi change the assembly code of a running process -

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

C++ 11 "class" keyword -