Skip to content

Commit

Permalink
recycle connect when execute begin statment error (#108)
Browse files Browse the repository at this point in the history
* recycle connect when execute begin statment error
  • Loading branch information
chicliz authored Sep 16, 2020
1 parent b065ccb commit 8279947
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions proxy/server/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,14 @@ func (se *SessionExecutor) getTransactionConn(sliceName string) (pc *backend.Poo

if !se.isAutoCommit() {
if err = pc.SetAutoCommit(0); err != nil {
pc.Close()
pc.Recycle()
return
}
} else {
if err = pc.Begin(); err != nil {
pc.Close()
pc.Recycle()
return
}
}
Expand Down

0 comments on commit 8279947

Please sign in to comment.