Skip to content

Commit

Permalink
checkpoint
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Ortel <[email protected]>
  • Loading branch information
jortel committed Oct 9, 2024
1 parent 8bb4d77 commit a6cc2f0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions database/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,11 @@ func (c *Conn) release() {
}
}

// endTx report transaction has ended.
func (c *Conn) endTx() {
c.hasTx = false
}

// Stmt is a SQL/DDL statement.
type Stmt struct {
wrapped driver.Stmt
Expand Down Expand Up @@ -306,7 +311,7 @@ type Tx struct {
// Releases the mutex.
func (t *Tx) Commit() (err error) {
defer func() {
t.conn.hasTx = false
t.conn.endTx()
t.conn.release()
}()
err = t.wrapped.Commit()
Expand All @@ -318,7 +323,7 @@ func (t *Tx) Commit() (err error) {
// Releases the mutex.
func (t *Tx) Rollback() (err error) {
defer func() {
t.conn.hasTx = false
t.conn.endTx()
t.conn.release()
}()
err = t.wrapped.Rollback()
Expand Down

0 comments on commit a6cc2f0

Please sign in to comment.