2018-05-31 11:51

@JFinal 原因找到了,表必须设置为InnoDB引擎时才支持事务,MyISAM并不支持事务。谢谢老大来解答

2018-05-31 11:27

@JFinal
改成如下写法
private boolean editUserAndInvitorRef(SysUser user, UserInvite inviteRef) {
boolean succeed = Db.tx(new IAtom() {
@Override
public boolean run() throws SQLException {
user.save();
inviteRef.set("accept_user_id", user.getStr("ids") + "00000000");
inviteRef.save();
return true;
}
});
return succeed;
}
依然没有回滚

2018-05-31 11:17

@JFinal 报错:com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'accept_user_id' at row 1,没有异常抛出