Commit f6730bd4 authored by Jason Moiron's avatar Jason Moiron

add tracing for begin/commit/rollback,...

add tracing for begin/commit/rollback, 047aa496231b62db778d98cc2fdb9dfda17ccbb4, from jeo shaw upstream on gorp
parent e3bb9d17
......@@ -332,6 +332,7 @@ func (m *DbMap) Exec(query string, args ...interface{}) (sql.Result, error) {
// Begin starts a modl Transaction
func (m *DbMap) Begin() (*Transaction, error) {
tx, err := m.Dbx.Beginx()
if err != nil {
return nil, err
......@@ -515,11 +515,13 @@ func (t *Transaction) Exec(query string, args ...interface{}) (sql.Result, error
// Commits the underlying database transaction
func (t *Transaction) Commit() error {
return t.tx.Commit()
// Rolls back the underlying database transaction
func (t *Transaction) Rollback() error {
return t.tx.Rollback()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment