zoukankan      html  css  js  c++  java
  • 最简单的重试机制

    
    
    
    
    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;
    }
    }
  • 相关阅读:
    栈和队列
    链表
    map
    二叉平衡树旋转
    二叉排序树详情
    红黑树详情
    查并集
    动态规划
    位操作
    字典树
  • 原文地址:https://www.cnblogs.com/xmanblue/p/6006504.html
Copyright © 2011-2022 走看看