try {
return dao.updateBanana(d);
}catch(DeadlockLoserDataAccessException e) {
logger.error("An unexpected error occurred for userId {} , exception : {}.",userId,e.getMessage());
try {
//增加出错重试,在产生死锁的异常中,重试可能有很大几率成功
return dao.updateBanana(d);
}catch (DeadlockLoserDataAccessException ex) {
logger.error("An unexpected error occurred for userId {} again, exception : {}.",userId,e.getMessage());
return 0;
}
}

相关文章:

  • 2021-10-06
  • 2021-12-19
  • 2021-09-19
  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-09
  • 2022-12-23
  • 2021-12-10
  • 2021-12-14
  • 2022-12-23
  • 2021-12-18
  • 2021-10-26
相关资源
相似解决方案