Transaction

err处理写反了
This commit is contained in:
Hubery 2015-01-13 11:09:43 +08:00
parent 07c628c7e9
commit 8bd902814f
1 changed files with 1 additions and 1 deletions

View File

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