mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 17:44:43 +01:00
update transaction modes
This commit is contained in:
@@ -30,6 +30,11 @@ namespace Emby.Server.Implementations.Data
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
protected TransactionMode TransactionMode
|
||||
{
|
||||
get { return TransactionMode.Immediate; }
|
||||
}
|
||||
|
||||
static BaseSqliteRepository()
|
||||
{
|
||||
SQLite3.EnableSharedCache = false;
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace Emby.Server.Implementations.Data
|
||||
connection.RunInTransaction(db =>
|
||||
{
|
||||
SaveDisplayPreferences(displayPreferences, userId, client, db);
|
||||
});
|
||||
}, TransactionMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -147,7 +147,7 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
SaveDisplayPreferences(displayPreference, userId, displayPreference.Client, db);
|
||||
}
|
||||
});
|
||||
}, TransactionMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace Emby.Server.Implementations.Data
|
||||
|
||||
statement.MoveNext();
|
||||
}
|
||||
});
|
||||
}, TransactionMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -108,7 +108,7 @@ namespace Emby.Server.Implementations.Data
|
||||
statement.TryBind("@ResultId", id.ToGuidParamValue());
|
||||
statement.MoveNext();
|
||||
}
|
||||
});
|
||||
}, TransactionMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -124,7 +124,7 @@ namespace Emby.Server.Implementations.Data
|
||||
var commandText = "delete from FileOrganizerResults";
|
||||
|
||||
db.Execute(commandText);
|
||||
});
|
||||
}, TransactionMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -316,7 +316,7 @@ namespace Emby.Server.Implementations.Data
|
||||
AddColumn(db, "MediaStreams", "RefFrames", "INT", existingColumnNames);
|
||||
AddColumn(db, "MediaStreams", "KeyFrames", "TEXT", existingColumnNames);
|
||||
AddColumn(db, "MediaStreams", "IsAnamorphic", "BIT", existingColumnNames);
|
||||
});
|
||||
}, TransactionMode);
|
||||
|
||||
string[] postQueries =
|
||||
|
||||
@@ -697,7 +697,7 @@ namespace Emby.Server.Implementations.Data
|
||||
connection.RunInTransaction(db =>
|
||||
{
|
||||
SaveItemsInTranscation(db, tuples);
|
||||
});
|
||||
}, TransactionMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2211,7 +2211,7 @@ namespace Emby.Server.Implementations.Data
|
||||
index++;
|
||||
}
|
||||
}
|
||||
});
|
||||
}, TransactionMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4531,7 +4531,7 @@ namespace Emby.Server.Implementations.Data
|
||||
|
||||
// Delete the item
|
||||
ExecuteWithSingleParam(db, "delete from TypedBaseItems where guid=@Id", id.ToGuidParamValue());
|
||||
});
|
||||
}, TransactionMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace Emby.Server.Implementations.Data
|
||||
|
||||
AddColumn(db, "userdata", "AudioStreamIndex", "int", existingColumnNames);
|
||||
AddColumn(db, "userdata", "SubtitleStreamIndex", "int", existingColumnNames);
|
||||
});
|
||||
}, TransactionMode);
|
||||
|
||||
ImportUserDataIfNeeded(connection);
|
||||
}
|
||||
@@ -116,7 +116,7 @@ namespace Emby.Server.Implementations.Data
|
||||
statement.TryBind("@IsUserDataImported", true);
|
||||
statement.MoveNext();
|
||||
}
|
||||
});
|
||||
}, TransactionMode);
|
||||
}
|
||||
|
||||
private void ImportUserData(IDatabaseConnection connection, string file)
|
||||
@@ -128,7 +128,7 @@ namespace Emby.Server.Implementations.Data
|
||||
connection.RunInTransaction(db =>
|
||||
{
|
||||
db.Execute("REPLACE INTO userdata(" + columns + ") SELECT " + columns + " FROM UserDataBackup.userdata;");
|
||||
});
|
||||
}, TransactionMode);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -197,7 +197,7 @@ namespace Emby.Server.Implementations.Data
|
||||
connection.RunInTransaction(db =>
|
||||
{
|
||||
SaveUserData(db, userId, key, userData);
|
||||
});
|
||||
}, TransactionMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -271,7 +271,7 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
SaveUserData(db, userId, userItemData.Key, userItemData);
|
||||
}
|
||||
});
|
||||
}, TransactionMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace Emby.Server.Implementations.Data
|
||||
statement.TryBind("@data", serialized);
|
||||
statement.MoveNext();
|
||||
}
|
||||
});
|
||||
}, TransactionMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -164,7 +164,7 @@ namespace Emby.Server.Implementations.Data
|
||||
statement.TryBind("@id", user.Id.ToGuidParamValue());
|
||||
statement.MoveNext();
|
||||
}
|
||||
});
|
||||
}, TransactionMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user