-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
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
此项目中的,数据库事务写法无效(错误) #10
Comments
这样写都是无效的。。。。。。 |
只有这样才行 |
这样写也有效 那就是save的问题了 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
项目中的事务基本都是想上面这种写法,内嵌函数中的数据库操作并没用用到 tx *gdb.TX 而是直接用 dao.User.Ctx(ctx)
这些操作根本就不在事务中运行,所以上面这种写法,会导致第一次写入操作成功(无论第二次操作是否成功)
当然 这种错误写法对单次写入操作并不影响 因为单次写入根本不需要事务
The text was updated successfully, but these errors were encountered: