You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There seems to be a race condition if we have 2 goroutines try to call the same db read at the same time (for the test I have multiple goroutines so the test is more likely to hit the race condition):
one call is in a transaction the other one is not -> FAIL
both calls in a transaction -> SUCCESS
both calls outside of transaction -> SUCCESS
If we set PrepareStmt to false it will work as expected
The text was updated successfully, but these errors were encountered:
GORM Playground Link
go-gorm/playground#783
Description
Requirements:
sqlDB.SetMaxOpenConns
to1
PrepareStmt
totrue
There seems to be a race condition if we have 2 goroutines try to call the same db read at the same time (for the test I have multiple goroutines so the test is more likely to hit the race condition):
If we set
PrepareStmt
tofalse
it will work as expectedThe text was updated successfully, but these errors were encountered: