diff --git a/osu.Game/Database/BeatmapDatabase.cs b/osu.Game/Database/BeatmapDatabase.cs index 66c348279d..ff58031c57 100644 --- a/osu.Game/Database/BeatmapDatabase.cs +++ b/osu.Game/Database/BeatmapDatabase.cs @@ -181,15 +181,18 @@ namespace osu.Game.Database public void Import(IEnumerable beatmapSets) { - connection.BeginTransaction(); - - foreach (var s in beatmapSets) + lock (connection) { - connection.InsertWithChildren(s, true); - BeatmapSetAdded?.Invoke(s); - } + connection.BeginTransaction(); - connection.Commit(); + foreach (var s in beatmapSets) + { + connection.InsertWithChildren(s, true); + BeatmapSetAdded?.Invoke(s); + } + + connection.Commit(); + } } public void Delete(BeatmapSetInfo beatmapSet)