解决javax.persistence.TransactionRequiredException: Executing an update/delete query错误

Spring4+Spring4MVC+SpringData+JPA+Hibernate4项目出现了

HTTP Status 500 - Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: Executing an update/delete query; nested exception is javax.persistence.TransactionRequiredException: Executing an update/delete query

错误,解决方案
在@Modifying后面加@Transactional

你可能感兴趣的:(javaweb)