mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 04:02:59 +08:00
Centralise transaction committing
This commit is contained in:
parent
6de037127d
commit
29fcd210aa
@ -198,7 +198,7 @@ namespace osu.Game.Beatmaps
|
||||
context.SaveChanges();
|
||||
}
|
||||
|
||||
transaction.Commit();
|
||||
context.SaveChanges(transaction);
|
||||
return set;
|
||||
}
|
||||
}
|
||||
@ -313,9 +313,7 @@ namespace osu.Game.Beatmaps
|
||||
}
|
||||
|
||||
context.ChangeTracker.AutoDetectChangesEnabled = true;
|
||||
context.SaveChanges();
|
||||
|
||||
transaction.Commit();
|
||||
context.SaveChanges(transaction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -93,6 +93,13 @@ namespace osu.Game.Database
|
||||
modelBuilder.Entity<BeatmapInfo>().HasOne(b => b.BaseDifficulty);
|
||||
}
|
||||
|
||||
public new int SaveChanges(IDbContextTransaction transaction = null)
|
||||
{
|
||||
var ret = base.SaveChanges();
|
||||
transaction?.Commit();
|
||||
return ret;
|
||||
}
|
||||
|
||||
private class OsuDbLoggerFactory : ILoggerFactory
|
||||
{
|
||||
#region Disposal
|
||||
|
Loading…
Reference in New Issue
Block a user