2019-09-17 06:29

问题已解决,谢谢波总

2019-09-14 09:17

Db.tx(new IAtom() {
@Override
public boolean run() throws SQLException {
account.setCreateTime(new Date());
account.setType(JMAccountDao.TYPE_ADMIN);

JMResult result = accountDao.save(account, password, JMAccountDao.TYPE_ADMIN, getIp());
AccountAdmin accountAdmin = getModel(AccountAdmin.class);
accountAdmin.setAccountId(account.getId());
if (avatar != null) {
accountAdmin.setAvatar(JMUploadKit.uploadPath+"image/"+avatar.getName());
}
if (realImage != null) {
accountAdmin.setRealImage(JMUploadKit.uploadPath+"image/"+realImage.getName());
}

boolean flag = accountAdminDao.save(accountAdmin);
if(flag){
if (roleId != null) {
accountAdmin = accountAdminDao.getById(accountAdmin.getId());
flag = roleAccountDao.band(accountAdmin.getAccountId(), roleId);
}
}

return result.isOk() && flag;
}
});

我改db,保存异常,数据不回滚

2019-09-10 23:05

me.setInjectDependency(true);已经配置了, @Inject在dao里面使用,包括@Before(Tx.class) 也是,但是无效