More commits for db read/write split

This commit is contained in:
Rick Falkvinge
2012-11-06 08:05:11 +00:00
parent 63b9fc8f1b
commit 37425a6b08
3 changed files with 4 additions and 4 deletions
@@ -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
+1 -1
View File
@@ -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());
}
}
}
+1 -1
View File
@@ -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())
{