javax.persistence.TransactionRequiredException: Executing an update/delete query 异常

错误信息:org.springframework.dao.InvalidDataAccessApiUsageException: Executing an update/delete query; nested exception is javax.persistence.TransactionRequiredException: Executing an update/delete query
错误信息:Caused by: javax.persistence.TransactionRequiredException: Executing an update/delete query

javax.persistence.TransactionRequiredException: Executing an update/delete query 异常_第1张图片代码截图
原因: 粗心大意贴少了事务注解
在增/删/改的时候要事务注解
@Transactional : (org.springframework.transaction.annotation.Transactional)

javax.persistence.TransactionRequiredException: Executing an update/delete query 异常_第2张图片

你可能感兴趣的:(javax.persistence.TransactionRequiredException: Executing an update/delete query 异常)