fix connections leak
This commit is contained in:
parent
7b927900e9
commit
b947dee882
@ -5,7 +5,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func BeginTransaction(db *gorm.DB) {
|
func BeginTransaction(db *gorm.DB) {
|
||||||
if !db.Config.SkipDefaultTransaction {
|
if !db.Config.SkipDefaultTransaction && db.Error == nil {
|
||||||
if tx := db.Begin(); tx.Error == nil {
|
if tx := db.Begin(); tx.Error == nil {
|
||||||
db.Statement.ConnPool = tx.Statement.ConnPool
|
db.Statement.ConnPool = tx.Statement.ConnPool
|
||||||
db.InstanceSet("gorm:started_transaction", true)
|
db.InstanceSet("gorm:started_transaction", true)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user