Skip to content

Commit

Permalink
Try rollback only if mysql.Error
Browse files Browse the repository at this point in the history
  • Loading branch information
michalderkacz committed Sep 26, 2012
1 parent a50040b commit 0e05c70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autorc/autorecon.go
Expand Up @@ -214,7 +214,7 @@ func (c *Conn) Begin(f func(mysql.Transaction, ...interface{}) error, args ...in
}
}
if c.reconnectIfNetErr(&nn, &err); err != nil {
if tr.IsValid() {
if _, ok := err.(*mysql.Error); ok && tr.IsValid() {
tr.Rollback()
}
return err
Expand Down

0 comments on commit 0e05c70

Please sign in to comment.