Skip to content

Commit

Permalink
Mark a connection bad if a transaction fails to start.
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisHines committed Oct 21, 2015
1 parent 2f2071e commit 7597359
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func (c *Conn) Begin() (driver.Tx, error) {
c.tx = &Tx{c: c}
err := c.setAutoCommitAttr(api.SQL_AUTOCOMMIT_OFF)
if err != nil {
c.bad = true
return nil, err
}
return c.tx, nil
Expand Down

0 comments on commit 7597359

Please sign in to comment.