scope: Catch error for db.Commit()

This commit is contained in:
shenli 2016-01-04 13:32:35 +08:00
parent 4c52351b3e
commit 499b5b7615
1 changed files with 1 additions and 1 deletions

View File

@ -380,7 +380,7 @@ func (scope *Scope) CommitOrRollback() *Scope {
if scope.HasError() { if scope.HasError() {
db.Rollback() db.Rollback()
} else { } else {
db.Commit() scope.Err(db.Commit())
} }
scope.db.db = scope.db.parent.db scope.db.db = scope.db.parent.db
} }