-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
app.POST(BusiAPI+"/SagaBTransOutGorm", dtmutil.WrapHandler(func(c *gin.Context) interface{} {
req := reqFrom(c)
barrier := MustBarrierFromGin(c)
tx := dbGet().DB.Begin()
return barrier.Call(tx.Statement.ConnPool.(*sql.Tx), func(tx1 *sql.Tx) error {
return tx.Exec("update dtm_busi.user_account set balance = balance + ? where user_id = ?", -req.Amount, TransOutUID).Error
})
}))
报错信息:
panic: interface conversion: gorm.ConnPool is *gorm.PreparedStmtTX, not *sql.Tx [recovered]
panic: interface conversion: gorm.ConnPool is *gorm.PreparedStmtTX, not *sql.Tx
Metadata
Metadata
Assignees
Labels
No labels