From 929f68bd87ea71d084be2b38f21dcf806efdec07 Mon Sep 17 00:00:00 2001 From: Brice Lambson Date: Wed, 8 Apr 2020 13:51:12 -0700 Subject: [PATCH] Use SQLite write-ahead logging and shared caches This will result in less locking and, thus, greater throughput. --- .../samples/ApiAuthSample/appsettings.json | 2 +- .../Mocks/StartupOpenIdConnectTesting.cs | 2 +- .../ForTesting/Mocks/StartupSocialTesting.cs | 2 +- src/MusicStore/samples/MusicStore/Startup.cs | 2 +- .../MusicStore/StartupNtlmAuthentication.cs | 2 +- .../MusicStore/StartupOpenIdConnect.cs | 2 +- src/Mvc/benchmarkapps/BasicApi/Startup.cs | 2 +- src/Mvc/benchmarkapps/BasicViews/Startup.cs | 2 +- .../content/BlazorServerWeb-CSharp/app.db | Bin 106496 -> 106496 bytes .../BlazorServerWeb-CSharp/appsettings.json | 2 +- .../content/RazorPagesWeb-CSharp/app.db | Bin 106496 -> 106496 bytes .../RazorPagesWeb-CSharp/appsettings.json | 2 +- .../content/StarterWeb-CSharp/app.db | Bin 106496 -> 106496 bytes .../StarterWeb-CSharp/appsettings.json | 2 +- .../content/Angular-CSharp/appsettings.json | 8 ++++---- .../content/React-CSharp/appsettings.json | 8 ++++---- 16 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/Identity/ApiAuthorization.IdentityServer/samples/ApiAuthSample/appsettings.json b/src/Identity/ApiAuthorization.IdentityServer/samples/ApiAuthSample/appsettings.json index 9a0be860ec..343a2253d4 100644 --- a/src/Identity/ApiAuthorization.IdentityServer/samples/ApiAuthSample/appsettings.json +++ b/src/Identity/ApiAuthorization.IdentityServer/samples/ApiAuthSample/appsettings.json @@ -1,6 +1,6 @@ { "ConnectionStrings": { - "DefaultConnection": "DataSource=app.db" + "DefaultConnection": "DataSource=app.db;Cache=Shared" }, "IdentityServer": { "Clients": { diff --git a/src/MusicStore/samples/MusicStore/ForTesting/Mocks/StartupOpenIdConnectTesting.cs b/src/MusicStore/samples/MusicStore/ForTesting/Mocks/StartupOpenIdConnectTesting.cs index 677d93abdd..4dbd321653 100644 --- a/src/MusicStore/samples/MusicStore/ForTesting/Mocks/StartupOpenIdConnectTesting.cs +++ b/src/MusicStore/samples/MusicStore/ForTesting/Mocks/StartupOpenIdConnectTesting.cs @@ -46,7 +46,7 @@ namespace MusicStore // Add EF services to the services container // Add EF services to the services container services.AddDbContext(options => - options.UseSqlite("Data Source=MusicStore.db")); + options.UseSqlite("Data Source=MusicStore.db;Cache=Shared")); // Add Identity services to the services container services.AddIdentity() diff --git a/src/MusicStore/samples/MusicStore/ForTesting/Mocks/StartupSocialTesting.cs b/src/MusicStore/samples/MusicStore/ForTesting/Mocks/StartupSocialTesting.cs index 2bc26bbb51..28392e6205 100644 --- a/src/MusicStore/samples/MusicStore/ForTesting/Mocks/StartupSocialTesting.cs +++ b/src/MusicStore/samples/MusicStore/ForTesting/Mocks/StartupSocialTesting.cs @@ -46,7 +46,7 @@ namespace MusicStore // Add EF services to the services container services.AddDbContext(options => - options.UseSqlite("Data Source=MusicStore.db")); + options.UseSqlite("Data Source=MusicStore.db;Cache=Shared")); // Add Identity services to the services container services.AddIdentity() diff --git a/src/MusicStore/samples/MusicStore/Startup.cs b/src/MusicStore/samples/MusicStore/Startup.cs index 74aa6931b8..98b8168b10 100644 --- a/src/MusicStore/samples/MusicStore/Startup.cs +++ b/src/MusicStore/samples/MusicStore/Startup.cs @@ -39,7 +39,7 @@ namespace MusicStore // Add EF services to the services container services.AddDbContext(options => - options.UseSqlite("Data Source=MusicStore.db")); + options.UseSqlite("Data Source=MusicStore.db;Cache=Shared")); // Add Identity services to the services container services.AddIdentity() diff --git a/src/MusicStore/samples/MusicStore/StartupNtlmAuthentication.cs b/src/MusicStore/samples/MusicStore/StartupNtlmAuthentication.cs index 86860af5e5..94154900eb 100644 --- a/src/MusicStore/samples/MusicStore/StartupNtlmAuthentication.cs +++ b/src/MusicStore/samples/MusicStore/StartupNtlmAuthentication.cs @@ -57,7 +57,7 @@ namespace MusicStore // Add EF services to the services container services.AddDbContext(options => - options.UseSqlite("Data Source=MusicStore.db")); + options.UseSqlite("Data Source=MusicStore.db;Cache=Shared")); // Add Identity services to the services container services.AddIdentity() diff --git a/src/MusicStore/samples/MusicStore/StartupOpenIdConnect.cs b/src/MusicStore/samples/MusicStore/StartupOpenIdConnect.cs index e44deae3f7..b469fba48a 100644 --- a/src/MusicStore/samples/MusicStore/StartupOpenIdConnect.cs +++ b/src/MusicStore/samples/MusicStore/StartupOpenIdConnect.cs @@ -56,7 +56,7 @@ namespace MusicStore // Add EF services to the services container services.AddDbContext(options => - options.UseSqlite("Data Source=MusicStore.db")); + options.UseSqlite("Data Source=MusicStore.db;Cache=Shared")); // Add Identity services to the services container services.AddIdentity() diff --git a/src/Mvc/benchmarkapps/BasicApi/Startup.cs b/src/Mvc/benchmarkapps/BasicApi/Startup.cs index a7e4a0dac6..98a0b55ef4 100644 --- a/src/Mvc/benchmarkapps/BasicApi/Startup.cs +++ b/src/Mvc/benchmarkapps/BasicApi/Startup.cs @@ -92,7 +92,7 @@ namespace BasicApi _isSQLite = true; services .AddEntityFrameworkSqlite() - .AddDbContextPool(options => options.UseSqlite("Data Source=BasicApi.db")); + .AddDbContextPool(options => options.UseSqlite("Data Source=BasicApi.db;Cache=Shared")); break; case "SQLSERVER": diff --git a/src/Mvc/benchmarkapps/BasicViews/Startup.cs b/src/Mvc/benchmarkapps/BasicViews/Startup.cs index 53c561bd76..624a0d803f 100644 --- a/src/Mvc/benchmarkapps/BasicViews/Startup.cs +++ b/src/Mvc/benchmarkapps/BasicViews/Startup.cs @@ -73,7 +73,7 @@ namespace BasicViews _isSQLite = true; services .AddEntityFrameworkSqlite() - .AddDbContextPool(options => options.UseSqlite("Data Source=BasicViews.db")); + .AddDbContextPool(options => options.UseSqlite("Data Source=BasicViews.db;Cache=Shared")); break; case "SQLSERVER": diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/app.db b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/app.db index ec163057f1f5433ac77fa2fea05aa4a544e6ded0..e1abab650a183c5bbd3e126e198f384ebab83748 100644 GIT binary patch delta 51 zcmZoTz}9epO(r