OSXアプリケーションでSQLite3のFMDatabaseラッパーを使用しています。私は、データベースへの挿入のトンを行いますFMDatabase/SQLite3で使用されている "Too many files open"問題
FMResultSet *results;
results= [db executeQuery:@"select count(*) from `items` where key = ?",[keyPath lowercaseString],nil];
while([results next])
{
if([results unsignedLongLongIntForColumnIndex:0]>0){
updateOperation=TRUE;
}
}
[results close];
if(updateOperation){
[db executeUpdate:@"update `items` set OSXsize=?,OSXOsize=?, OSXDate=?, UUID=?,sourceFile=?,tombStone=0,SandBoxBookMark=?,songname=?,albumartist=? where key=?",
size,originalSize, convertedDate,UUID,sourcePath,bookmark,fileName,albumArtist,[keyPath lowercaseString] , nil];
}
else
{
[db executeUpdate:@"insert into `items`(key,filepath, OSXsize, OSXOsize, OSXdate,UUID,sourceFile,tombStone,SandBoxBookMark,songname,albumartist) values(?,?,?,?,?,?,?,0,?,?,?)",
[keyPath lowercaseString], dapPath, size,originalSize, convertedDate,UUID,sourcePath,bookmark,fileName,albumArtist, nil];
}
アプリはアクティビティモニタに進むにつれて、私はしかし、私は添付4725の+ファイルハンドルを見ています、一度データベースを開きます
/Users/userA/Library/Containers/com.map-pin.Dapper/Data/Library/Application Support/com.map-pin.Dapper/dapperright.sqlite
15
16
...
4724
4725
fmdatabasequeueを使用すると、適切に閉じられていないクエリ結果セットが表示されるログが表示される – JeremyLaurenson
あなたが解決したことを知ってうれしいです。 –