Objective c 当firefox运行MacOS时,无法更新firefox sqlite数据库
我有以下代码片段来更新firefox扩展sqlite数据库Objective c 当firefox运行MacOS时,无法更新firefox sqlite数据库,objective-c,macos,sqlite,Objective C,Macos,Sqlite,我有以下代码片段来更新firefox扩展sqlite数据库 NSString * profileFolderPath = [[ @"~" stringByExpandingTildeInPath] stringByAppendingPathComponent:@"/Library/Application Support/Firefox/Profiles"]; NSString *sqlitePath = [pathToProfileFolder stringByAppendingPath
NSString * profileFolderPath = [[ @"~" stringByExpandingTildeInPath] stringByAppendingPathComponent:@"/Library/Application Support/Firefox/Profiles"];
NSString *sqlitePath = [pathToProfileFolder stringByAppendingPathComponent:@"extensions.sqlite"];
int rc = sqlite3_open([sqlitePath UTF8String], &db);
if( rc )
{
NSLog(@"enable extension :%@\n",[NSString stringWithCString:sqlite3_errmsg(db)]);
sqlite3_close(db);
return NO;
}
else {
NSLog(@"opened entensions db successfully \n");
}
// check the values for active and userDisabled fields
rc = sqlite3_exec(db,"SELECT active,userDisabled FROM addon where id='myId.com'",sqliteCallback,0,&zErrMsg);
if (rc!=SQLITE_OK ) {
NSLog(@"error quering the entensions database :%@\n",[NSString stringWithCString:zErrMsg]);
if(zErrMsg)
sqlite3_free(zErrMsg);
sqlite3_close(db);
return NO;
// handle error
}
当firefox应用程序未处于运行状态时,我可以读取值并更新数据库,但当firefox运行时,我无法从数据库中读取值,因为sqlite3_exec语句返回值5,我可以在控制台中看到错误:“查询扩展数据库时出错:数据库已锁定”
如何解决此问题。请提供帮助。您不能在b/c firefox运行时打开自己的配置文件(扩展数据库文件是firefox自己的配置文件)。您不能在b/c firefox运行时打开自己的配置文件(扩展数据库文件是firefox自己的配置文件)