SQL锁定超时

时间:2013-04-18 03:28:28

标签: java sql database

我不确定这是Java还是数据库问题

public boolean addQualification(List<Qualification> qualificationList) throws SQLException {
    String sql = "insert into Qualification(QID,EID, Qualification) values (?,?,?)";
    boolean add = false;
    for (Qualification qualification : qualificationList) {
        Object[] data = {qualification.getQid(), qualification.getEid(),  qualification.getQualification()};
        int result = DBHandle.setData(connection, sql, data);
        if (result > 0) {
            add = true;
        } else {
            add = false;
            connection.rollback();
            break;
        }
    }
    return add;
}

当我运行此代码时,我得到“java.sql.SQLException:超出锁定等待超时;尝试重启事务”异常

0 个答案:

没有答案