We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
定义了事务,如果在下面err出错之后进入defer,但是并没有rollback,这样会导致数据库锁吧? o := orm.NewOrm() err = o.Begin() defer func() { if err == nil { if o.Commit() != nil { if errRollback := o.Rollback(); errRollback != nil { err = errRollback } } } }() if err != nil { return }
o := orm.NewOrm() err = o.Begin() defer func() { if err == nil { if o.Commit() != nil { if errRollback := o.Rollback(); errRollback != nil { err = errRollback } } } }() if err != nil { return }
The text was updated successfully, but these errors were encountered:
对,确实,需要修改
Sorry, something went wrong.
defer func() { if err == nil { err = tx.Commit().Error } else { err = tx.Rollback().Error }
}()
No branches or pull requests
定义了事务,如果在下面err出错之后进入defer,但是并没有rollback,这样会导致数据库锁吧?
o := orm.NewOrm() err = o.Begin() defer func() { if err == nil { if o.Commit() != nil { if errRollback := o.Rollback(); errRollback != nil { err = errRollback } } } }() if err != nil { return }
The text was updated successfully, but these errors were encountered: