diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index b81e239015..55c3e192e3 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -184,7 +184,7 @@ namespace osu.Game.Beatmaps { var context = importContext.Value; - using (var transaction = context.Database.BeginTransaction()) + using (var transaction = context.BeginTransaction()) { // create local stores so we can isolate and thread safely, and share a context/transaction. var iFiles = new FileStore(() => context, storage); @@ -295,7 +295,7 @@ namespace osu.Game.Beatmaps { var context = importContext.Value; - using (var transaction = context.Database.BeginTransaction()) + using (var transaction = context.BeginTransaction()) { context.ChangeTracker.AutoDetectChangesEnabled = false; diff --git a/osu.Game/Database/OsuDbContext.cs b/osu.Game/Database/OsuDbContext.cs index cf97a8f216..6c267811a1 100644 --- a/osu.Game/Database/OsuDbContext.cs +++ b/osu.Game/Database/OsuDbContext.cs @@ -92,6 +92,12 @@ namespace osu.Game.Database modelBuilder.Entity().HasOne(b => b.BaseDifficulty); } + public IDbContextTransaction BeginTransaction() + { + // return Database.BeginTransaction(); + return null; + } + public new int SaveChanges(IDbContextTransaction transaction = null) { var ret = base.SaveChanges(); diff --git a/osu.Game/Input/KeyBindingStore.cs b/osu.Game/Input/KeyBindingStore.cs index b434ce4eb7..0a0cd3dd6f 100644 --- a/osu.Game/Input/KeyBindingStore.cs +++ b/osu.Game/Input/KeyBindingStore.cs @@ -39,7 +39,7 @@ namespace osu.Game.Input private void insertDefaults(IEnumerable defaults, int? rulesetId = null, int? variant = null) { using (var context = GetContext()) - using (var transaction = context.Database.BeginTransaction()) + using (var transaction = context.BeginTransaction()) { // compare counts in database vs defaults foreach (var group in defaults.GroupBy(k => k.Action))