diff options
Diffstat (limited to 'src/Jellyfin.Database/Jellyfin.Database.Implementations/DbConfiguration')
2 files changed, 28 insertions, 0 deletions
diff --git a/src/Jellyfin.Database/Jellyfin.Database.Implementations/DbConfiguration/DatabaseConfigurationOptions.cs b/src/Jellyfin.Database/Jellyfin.Database.Implementations/DbConfiguration/DatabaseConfigurationOptions.cs index b481a106f..682e5019b 100644 --- a/src/Jellyfin.Database/Jellyfin.Database.Implementations/DbConfiguration/DatabaseConfigurationOptions.cs +++ b/src/Jellyfin.Database/Jellyfin.Database.Implementations/DbConfiguration/DatabaseConfigurationOptions.cs @@ -9,4 +9,10 @@ public class DatabaseConfigurationOptions /// Gets or Sets the type of database jellyfin should use. /// </summary> public required string DatabaseType { get; set; } + + /// <summary> + /// Gets or Sets the kind of locking behavior jellyfin should perform. Possible options are "NoLock", "Pessimistic", "Optimistic". + /// Defaults to "NoLock". + /// </summary> + public DatabaseLockingBehaviorTypes LockingBehavior { get; set; } } diff --git a/src/Jellyfin.Database/Jellyfin.Database.Implementations/DbConfiguration/DatabaseLockingBehaviorTypes.cs b/src/Jellyfin.Database/Jellyfin.Database.Implementations/DbConfiguration/DatabaseLockingBehaviorTypes.cs new file mode 100644 index 000000000..3b2a55802 --- /dev/null +++ b/src/Jellyfin.Database/Jellyfin.Database.Implementations/DbConfiguration/DatabaseLockingBehaviorTypes.cs @@ -0,0 +1,22 @@ +namespace Jellyfin.Database.Implementations.DbConfiguration; + +/// <summary> +/// Defines all possible methods for locking database access for concurrent queries. +/// </summary> +public enum DatabaseLockingBehaviorTypes +{ + /// <summary> + /// Defines that no explicit application level locking for reads and writes should be done and only provider specific locking should be relied on. + /// </summary> + NoLock = 0, + + /// <summary> + /// Defines a behavior that always blocks all reads while any one write is done. + /// </summary> + Pessimistic = 1, + + /// <summary> + /// Defines that all writes should be attempted and when fail should be retried. + /// </summary> + Optimistic = 2 +} |
