Replace connection pool
This commit is contained in:
@@ -105,10 +105,9 @@ func (c *Conn) BeginEx(ctx context.Context, txOptions *TxOptions) (*Tx, error) {
|
||||
// All Tx methods return ErrTxClosed if Commit or Rollback has already been
|
||||
// called on the Tx.
|
||||
type Tx struct {
|
||||
conn *Conn
|
||||
connPool *ConnPool
|
||||
err error
|
||||
status int8
|
||||
conn *Conn
|
||||
err error
|
||||
status int8
|
||||
}
|
||||
|
||||
// Commit commits the transaction
|
||||
@@ -135,10 +134,6 @@ func (tx *Tx) CommitEx(ctx context.Context) error {
|
||||
tx.conn.die(errors.New("commit failed"))
|
||||
}
|
||||
|
||||
if tx.connPool != nil {
|
||||
tx.connPool.Release(tx.conn)
|
||||
}
|
||||
|
||||
return tx.err
|
||||
}
|
||||
|
||||
@@ -167,10 +162,6 @@ func (tx *Tx) RollbackEx(ctx context.Context) error {
|
||||
tx.conn.die(errors.New("rollback failed"))
|
||||
}
|
||||
|
||||
if tx.connPool != nil {
|
||||
tx.connPool.Release(tx.conn)
|
||||
}
|
||||
|
||||
return tx.err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user