踩坑记录:MySQLTransactionRollbackException- Deadlock..

踩坑记录:MySQLTransactionRollbackException- Deadlock..ERROR sn ls8 resource server hn mdw c i i i t c BeforeWfFeeC 61 发送失败 org springframew dao DeadlockLose Error updating database Cause com mysql cj jdbc

大家好,我是讯享网,很高兴认识大家。
ERROR sn(ls8-resource-server) hn(mdw) c.i.i.i.t.c.BeforeWfFeeController:61 - 发送失败 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 error may exist in com//FeeXXMapper.java (best guess) The error may involve com..mapper.FeeXXMapper.batchInsert-Inline The error occurred while setting parameters SQL: insert into fee_xx_item(id,apply_id,apply_detail_id,parent_apply_id,parent_apply_detail_id,parent_apply _detail_item_id,fee_code,fee_calibre,consumption_object,apply_amount,approval_amount,ext_in fo,complete_flag,fee_control_id,seq,enable_this_product,this_product_illustrate,product_cod e,frozen_amount,enable_frozen) values   (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) Cause: com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction ; Deadlock found when trying to get lock; try restarting transaction; nested exception is com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction 

讯享网

最近在做压测时遇到MySQLTransactionRollbackException: Deadlock...的问题,经排查发生的原因是:在接口中使用Transactional注解,且该接口的业务逻辑夹杂在两个或多个mapper(泛指对数据库的增删改)方法中间,业务逻辑处理时间长,高并发的状态下则会导致TransactionRollbackException,所以需要将与数据库操作的增删改方法都统一放在接口的最后。


讯享网

小讯
上一篇 2025-01-23 16:44
下一篇 2025-03-01 13:31

相关推荐

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/124344.html