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; }}
时间: 2024-10-17 23:44:55