denisenkom/go-mssqldb — pull request #45 by dimdin (2014-06-23 17:40:44+00:00)
Title: ErrBadConn to signal that the connection is in bad state

ErrBadConn is send only when there is a permanent network error and:
1) when Begin is called to begin a transaction,
or
2) when Exec/Query/QueryRow is called without an active transaction.
Upon receiving a ErrBadConn, the database/sql package, closes the connection and retries the Begin/Exec/etc in another connection.

@denisenkom please review