From d086fd5dd95f96eb6199829b7ff5db471da7d6bc Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 20 Nov 2009 15:54:14 +0000 Subject: [PATCH] Monotone-Parent: 18155a2d60bff7181a5a85a593a9eeddab055e95 Monotone-Revision: 3f1a705ea4e12fea3f816fcc523a8b481c081f11 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-11-20T15:54:14 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 7 +++++++ SoObjects/SOGo/SOGoUserDefaults.m | 9 ++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 30b4fbfff..2a1caa3a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-11-20 Wolfgang Sourdeau + + * SoObjects/SOGo/SOGoUserDefaults.m (_sqlJsonRepresentation:): the + escaping of "\\" was done in the wrong direction. + (-storeJSONProfileInDB:): we commit the transaction to avoid a + lock on the profile table. + 2009-11-19 Francis Lachapelle * SoObjects/Mailer/SOGoMailReply.m (-messageBody): don't try to diff --git a/SoObjects/SOGo/SOGoUserDefaults.m b/SoObjects/SOGo/SOGoUserDefaults.m index f08c4f276..ba4dc8d1a 100644 --- a/SoObjects/SOGo/SOGoUserDefaults.m +++ b/SoObjects/SOGo/SOGoUserDefaults.m @@ -262,7 +262,7 @@ static NSString *uidColumnName = @"c_uid"; sql = [jsonRepresentation mutableCopy]; [sql autorelease]; - [sql replaceString: @"\\\\" withString: @"\\"]; + [sql replaceString: @"\\" withString: @"\\\\"]; [sql replaceString: @"'" withString: @"''"]; return sql; @@ -307,6 +307,7 @@ static NSString *uidColumnName = @"c_uid"; { GCSChannelManager *cm; EOAdaptorChannel *channel; + EOAdaptorContext *context; NSException *ex; NSString *sql; BOOL rc; @@ -320,20 +321,22 @@ static NSString *uidColumnName = @"c_uid"; channel = [cm acquireOpenChannelForURL: [self tableURL]]; if (channel) { - if ([[channel adaptorContext] beginTransaction]) + context = [channel adaptorContext]; + if ([context beginTransaction]) { defFlags.ready = YES; ex = [channel evaluateExpressionX:sql]; if (ex) { [self errorWithFormat: @"could not run SQL '%@': %@", sql, ex]; - [[channel adaptorContext] rollbackTransaction]; + [context rollbackTransaction]; } else { rc = YES; defFlags.modified = NO; defFlags.isNew = NO; + [context commitTransaction]; } [cm releaseChannel: channel]; }