fix: use preparestmt in trasaction will use new conn
This commit is contained in:
parent
62fdc2bb3b
commit
8ad4bc44d3
2
gorm.go
2
gorm.go
@ -249,7 +249,7 @@ func (db *DB) Session(config *Session) *DB {
|
|||||||
if v, ok := db.cacheStore.Load(preparedStmtDBKey); ok {
|
if v, ok := db.cacheStore.Load(preparedStmtDBKey); ok {
|
||||||
preparedStmt := v.(*PreparedStmtDB)
|
preparedStmt := v.(*PreparedStmtDB)
|
||||||
tx.Statement.ConnPool = &PreparedStmtDB{
|
tx.Statement.ConnPool = &PreparedStmtDB{
|
||||||
ConnPool: db.Config.ConnPool,
|
ConnPool: db.Statement.ConnPool,
|
||||||
Mux: preparedStmt.Mux,
|
Mux: preparedStmt.Mux,
|
||||||
Stmts: preparedStmt.Stmts,
|
Stmts: preparedStmt.Stmts,
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user