aishivge 2019-10-03 21:33 采纳率: 100%
浏览 711
已结题

求大神 pringboot mybatis atomikos 事务超时未提交 要怎么解决呀!!!

所有配置参考的是: https://blog.csdn.net/lfwer/article/details/83901058

数据源配置

配置图片

java 代码配置

primary

图片说明

second

图片说明

serviceImpl代码

图片说明

报错信息

图片说明

2019-10-03 21:10:19.158  WARN 12120 --- [     Atomikos:4] c.a.icatch.imp.ActiveStateHandler        : Transaction com.tlw.bpm.engine.atomikos.spring.jdbc.tm157010820885800001 has timed out and will rollback.
2019-10-03 21:10:59.237 ERROR 12120 --- [p-nio-80-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.CannotAcquireLockException: 
### Error updating database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction
### The error may involve com.springboot.demo.dao.primary.PrimaryStudentDao.insert-Inline
### The error occurred while setting parameters
### SQL: INSERT INTO student(id,name)         VALUES (?,?)
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction
; Lock wait timeout exceeded; try restarting transaction; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction] with root cause

com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction
  • 写回答

2条回答 默认 最新

  • threenewbee 2019-10-03 22:36
    关注

    你是不是事务begin了没有加上commit提交
    导致一致锁定,超时。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
  • ¥50 如何openEuler 22.03上安装配置drbd
  • ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
  • ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)
  • ¥15 Windows11, backspace, enter, space键失灵