weed filer: mysql/postgres use ReadCommitted transaction isolation level for atomic rename

This commit is contained in:
Chris Lu 2019-04-01 11:03:04 -07:00
parent c5a3ff1c35
commit b4c276263f

View File

@ -26,7 +26,10 @@ type TxOrDB interface {
}
func (store *AbstractSqlStore) BeginTransaction(ctx context.Context) (context.Context, error) {
tx, err := store.DB.BeginTx(ctx, nil)
tx, err := store.DB.BeginTx(ctx, &sql.TxOptions{
Isolation: sql.LevelReadCommitted,
ReadOnly: false,
})
if err != nil {
return ctx, err
}