Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Set isolation level to SERIALIZABLE
  • Loading branch information
antigremlin committed Dec 9, 2021
commit 62ea71570aa0ed5cf24cca746e6cf32361e30ac6
2 changes: 1 addition & 1 deletion database/mysql/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ func (m *Mysql) Run(migration io.Reader) error {
}

func (m *Mysql) SetVersion(version int, dirty bool) error {
tx, err := m.conn.BeginTx(context.Background(), &sql.TxOptions{})
tx, err := m.conn.BeginTx(context.Background(), &sql.TxOptions{Isolation: sql.LevelSerializable})
if err != nil {
return &database.Error{OrigErr: err, Err: "transaction start failed"}
}
Expand Down