java.sql.SQLException: Lock wait timeout exceeded 该异常为一个service中调用了另一个service,两个service对同一表进行操作,造成事务嵌套,从而死锁. 解决办法:在当前方法前加入@Transactional(propagation=Propagation.SUPPORTS) @Transactional(propagation=Propagation.REQUIRED) // 容器不为这个方法开启事务 @Transactional…
错误信息如下: 2017-09-27 16:27:16.153 - [com.ldyun.base.service.impl.BaseRetailOrderServiceImpl] - 新增零售商品订单~org.springframework.dao.CannotAcquireLockException: ### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackExce…
1.错误信息 Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: Multiple representations of the same entity 2.错误原因 因为试图给 某一个new 的Transient对象 的某一个属性赋一个 已经Persistent 对象或者Detached 对象值.导致最后save 或者merge 这个…
添加链接池后批量添加更新出现了死锁 org.springframework.dao.DeadlockLoserDataAccessException: ### Error updating database. Cause: com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction### The…
笔者是使用spring4.0时,报的错误: 原因是没有引入spring-tx-4.0.0.RELEASE.jar包,將spring-tx-4.0.0.RELEASE.jar添加到build path中即可. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSession' defined in class path resource [beans.xml]: Re…
数据库用的hibernate,开发工具用的myeclipse,使用开发工具连接数据库生成hibernate基于xml的po类,运行时报org.springframework.dao.DataIntegrityViolationException 并且提示某个字段  not—null: 解决,查看了数据库字段类型为number类型,将生成的po对应字段改写成Integer类型,原因:开发工具生成的类型,与数据库number类型对象,但是如果数据是0会被过滤, 而Integer数据int的包装类型,…
org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushMode.AUTO or remove 'readOnly' marker from transaction definition 解决办法: 在执行service中一个方法bume…
题记:以前记录过一些自己遇到的BUG,这个行为,让我一看报错的提示信息就能定位到问题的所在,后来记得比较多了,好多是重复性的再加上比较忙就没有详细的记录了,今天的工作量比较小,就顺便记录一下,以便以后更快的解决此类问题. BUG的报错信息如下所示: org.springframework.dao.InvalidDataAccessApiUsageException: Parameter value [41] did not match expected type [java.lang.Integ…
报错:org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition. 搞开发的时候碰到…
public Wcrash getWcrashInfo(int id) { String sql = "select plateform_id,android_version,app_version_code,app_version_name,device_id," + "model,brand,product,stack_trace,crash_date,package_name from wcrash where id = ? "; return this.jd…