1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-26 12:51:29 +00:00

Merge pull request #1004 from fugr/patch-2

Transaction
This commit is contained in:
astaxie 2015-01-13 11:19:03 -08:00
commit d7fe5ef435

View File

@ -117,7 +117,7 @@ o.Begin()
... ...
user := User{Name: "slene"} user := User{Name: "slene"}
id, err := o.Insert(&user) id, err := o.Insert(&user)
if err != nil { if err == nil {
o.Commit() o.Commit()
} else { } else {
o.Rollback() o.Rollback()