TransactionRequiredException Executing an update/delete query

后端 未结 20 2142
没有蜡笔的小新
没有蜡笔的小新 2020-12-02 15:29

Hi I am using hibernate JPA with spring and mongodb and i am running my application on Glassfish-4.0.

My service class is :

@Component
public class T         


        
20条回答
  •  我在风中等你
    2020-12-02 15:41

    If the previous answers fail, make sure you use @Service stereotype for the class where you call the update method on your repository. I originally used @Component instead and it was not working, the simple change to @Service made it work.

提交回复
热议问题