大神们,有谁知道如何将spring mvc的事物配置在controller层吗?我现在的一些插入逻辑写在了controller层。可是事物不起作用,谁能帮帮我啊
将事务配置定义在Spring MVC的应用上下文(*-servlet.xml)中,将@Transactional注解打在Controller上
最好不要在controller中写逻辑,写在service层用@Transactional注解在@service下边