出现 CannotAcquireLockException 异常

项目出现  CannotAcquireLockException异常

原因:

百度了一下,是由于 Spring 事务嵌套造成死锁

结合自己的, handleWithdraw 方法底层有调用 其他 service,其他 service 加了 事务,造成事务嵌套,底层 service 报错,事务回滚,我 handleWithdraw 也有事务,也会回滚,形成死锁

 解决方法:

删除 handleWithdraw  方法上的   @Transactional

猜你喜欢

转载自www.cnblogs.com/wtx106/p/12469904.html