From 37425a6b087e8a8247e36cd9bfb542b6754eb03d Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Tue, 6 Nov 2012 08:05:11 +0000 Subject: [PATCH] More commits for db read/write split --- Logic/Special/Sweden/SwedishForumHandleProvider.cs | 4 ++-- Utility/BotCode/BlogTop50Scraper.cs | 2 +- Utility/Migrations/PeopleOptionalData.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Logic/Special/Sweden/SwedishForumHandleProvider.cs b/Logic/Special/Sweden/SwedishForumHandleProvider.cs index 52bf59bf..086d37e4 100644 --- a/Logic/Special/Sweden/SwedishForumHandleProvider.cs +++ b/Logic/Special/Sweden/SwedishForumHandleProvider.cs @@ -41,13 +41,13 @@ namespace Activizr.Logic.Special.Sweden throw new HandleException(newHandle, HandleErrorType.HandleNotFound); } - int[] members = PirateDb.GetDatabase().GetObjectsByOptionalData(ObjectType.Person, ObjectOptionalDataType.ForumAccountId, "" + newHandleAccountId); + int[] members = PirateDb.GetDatabaseForReading().GetObjectsByOptionalData(ObjectType.Person, ObjectOptionalDataType.ForumAccountId, "" + newHandleAccountId); if (members.Length > 1 || (members.Length == 1 && members[0] != personId)) { throw new HandleException(newHandle, HandleErrorType.HandleOccupied); } } - + int currentAccountId = person.SwedishForumAccountId; // Remove "party member" status from this account diff --git a/Utility/BotCode/BlogTop50Scraper.cs b/Utility/BotCode/BlogTop50Scraper.cs index a4997d11..09c7ff7d 100644 --- a/Utility/BotCode/BlogTop50Scraper.cs +++ b/Utility/BotCode/BlogTop50Scraper.cs @@ -49,7 +49,7 @@ namespace Activizr.Utility.BotCode match = match.NextMatch(); } - PirateDb.GetDatabase().StoreBlogTopList(DateTime.Today, rankingList.ToArray()); + PirateDb.GetDatabaseForWriting().StoreBlogTopList(DateTime.Today, rankingList.ToArray()); } } } \ No newline at end of file diff --git a/Utility/Migrations/PeopleOptionalData.cs b/Utility/Migrations/PeopleOptionalData.cs index 1baf035f..72e685bc 100644 --- a/Utility/Migrations/PeopleOptionalData.cs +++ b/Utility/Migrations/PeopleOptionalData.cs @@ -13,7 +13,7 @@ namespace Activizr.Utility.Migrations { public static void Migrate() { - PirateDb db = PirateDb.GetDatabase(); + PirateDb db = PirateDb.GetDatabaseForAdmin(); using (DbConnection connection = db.GetSqlServerDbConnection()) {