mirror of
https://github.com/ppy/osu
synced 2025-01-23 22:33:05 +00:00
Centralise BeginTransaction and disable transaction use for now
This commit is contained in:
parent
c089842adf
commit
4a68dd88cb
@ -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;
|
||||
|
||||
|
@ -92,6 +92,12 @@ namespace osu.Game.Database
|
||||
modelBuilder.Entity<BeatmapInfo>().HasOne(b => b.BaseDifficulty);
|
||||
}
|
||||
|
||||
public IDbContextTransaction BeginTransaction()
|
||||
{
|
||||
// return Database.BeginTransaction();
|
||||
return null;
|
||||
}
|
||||
|
||||
public new int SaveChanges(IDbContextTransaction transaction = null)
|
||||
{
|
||||
var ret = base.SaveChanges();
|
||||
|
@ -39,7 +39,7 @@ namespace osu.Game.Input
|
||||
private void insertDefaults(IEnumerable<KeyBinding> 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))
|
||||
|
Loading…
Reference in New Issue
Block a user