[OGo-Developer] userDefaults

Adam Tauno Williams developer@opengroupware.org
Tue, 23 Jan 2007 08:50:48 -0500


> We are running OGo and different persons log in with the
> same username. Some times OGo crashes with the following
> message:
>      class:       LSDBObjectCommandException
>      name:      LSDBObjectCommandException
>      reason:    userdefaults::delete failed: Could not write User-Defaults
> I think the crash occurs when different OGo sessions tries to write to disk
> the same userDefaults file.
> The line 254 of the file SOPE-4.4/libFoundation/Foundation/common.m is
>      filename = atomically ? [path stringByAppendingString:@"~"] : path;
> i.e., if the write is atomic a temporary file is used. The name of the
> temporary file is the name of the original file with "~" appended.

I log into OGo's WebUI multiple time simultaneously all day / every day.
It has never given me an error about saving defaults.

> Do you thing that replacing this line with
>   filename = path;
>   if(atomically) {
>     NSProcessInfo *proc = [NSProcessInfo processInfo];
>     filename = [NSString stringWithFormat:@"%@%@.txt",
>                          [path stringByDeletingLastPathComponent],
>                          [proc globallyUniqueString]];
>   }
> will solve the problem?