// 检查余量
Trans.exec(new Atom() {
Record _r = null;
@Override
public void run() {
int i = sendMsgDao.editMsgCount(r.getString("corp_id"));
if (i < 1) {// 更新失败--余量不足
sendMsgDao.editMsgRecordById(Chain.make("send_state", 0).add("error_msg", "短息余量不足"),
Cnd.where("id", "=", r.getString("id")));
} else {
_r = SendMsgUtil.smsSend(r.getString("accept_phone"), r.getString("content"), "", r.getString("attime"));
if(_r.getString("code").equals("500")){//发送失败
//插入错误日志
sendMsgDao.editMsgRecordById(Chain.make("send_state", 0).add("error_msg",_r.get("msg")),
Cnd.where("id", "=", r.getString("id")));
//回滚
throw new RuntimeException("回滚");
}
}
}
});
怎么才能回滚后,往数据表插入的错误日志不回滚。