Nulling out transaction upon commit and rollback
1 files changed, 6 insertions(+), 2 deletions(-) M database/db.go
M database/db.go => database/db.go +6 -2
@@ 41,7 41,9 @@ func (d *DB) CommitTx() error { return errors.New("You have no active db transaction") } if d.commit { return d.tx.Commit() err := d.tx.Commit() d.tx = nil return err } return nil @@ } 51,7 53,9 @@ func (d *DB) RollbackTx() error { if d.tx == nil { return errors.New("You have no active db transaction") } return d.tx.Rollback() err := d.tx.Rollback() d.tx = nil return err } // WillCommit will return the value of commit