org.springframework.dao.InvalidDataAccessApiUsageException
2014-10-15 10:08
381 查看
org.springframework.dao.InvalidDataAccessApiUsageException: Executing an update/delete query; nested exception is javax.persistence.TransactionRequiredException: Executing an update/delete query
不能用静态函数 static
@Transactional doesn't work on static function
public static int Licences.deleteAll() { return entityManager().createQuery("delete from Licences o").executeUpdate(); }
to
public int Licences.deleteAll() { return entityManager().createQuery("delete from Licences o").executeUpdate(); }
相关文章推荐
- OpenSessionInViewFilter与org.springframework.dao.InvalidDataAccessApiUsageException
- org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read
- org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read
- org.springframework.dao.InvalidDataAccessApiUsageException错误
- org.springframework.dao.InvalidDataAccessApiUsageException
- org.springframework.dao.InvalidDataAccessApiUsageException: Write
- org.springframework.dao.InvalidDataAccessApiUsageException问题解决
- javaEE-----org.springframework.dao.InvalidDataAccessApiUsageException: Write operation
- org.springframework.dao.InvalidDataAccessApiUsageException: OracleLobCreator needs to work on [oracl
- [spring]:org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode
- org.springframework.dao.InvalidDataAccessApiUsageException: read-only mode (FlushMode.MANUAL)
- hibernate异常:org.springframework.dao.InvalidDataAccessApiUsageException解决办法
- org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read
- An exception occurred: org.springframework.dao.InvalidDataAccessApiUsageException
- org.springframework.dao.InvalidDataAccessApiUsageException
- org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed
- org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.NEVER)
- org.springframework.dao.InvalidDataAccessApiUsageException:The given object has a null identifi的解决方案
- org.springframework.dao.InvalidDataAccessApiUsageException
- 异常积累:org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in