Skip to content

Commit 5783df4

Browse files
authored
Set isolation level
1 parent 71892aa commit 5783df4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

backend/mysql/mysql.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ type mysqlBackend struct {
5858

5959
// CreateWorkflowInstance creates a new workflow instance
6060
func (b *mysqlBackend) CreateWorkflowInstance(ctx context.Context, m history.WorkflowEvent) error {
61-
tx, err := b.db.BeginTx(ctx, nil)
61+
tx, err := b.db.BeginTx(ctx, &sql.TxOptions{
62+
Isolation: sql.LevelReadCommitted,
63+
})
6264
if err != nil {
6365
return errors.Wrap(err, "could not start transaction")
6466
}

0 commit comments

Comments
 (0)