mardi 5 avril 2016

iPad lost connection when executing queries in sqliteDatabase?

I am developing an app in which i am getting data from server & saving it in local database.When number of records are more then while entering data into database i get error as "Lost connection with iPad" i am not able to understand why this issue is occurring. Please help me out with this issue?

const char *dbpath = [databasePath UTF8String];
if(DATA != nil)
{

    [self updateComp:subcomponent];
    return YES;
}
else
{
    if (sqlite3_open(dbpath, &database) == SQLITE_OK)
    {
        NSString *insertSQL = “SQLL QUERY”;
        NSLog(@"%@",insertSQL);
        const char *insert_stmt = [insertSQL UTF8String];
        sqlite3_prepare_v2(database, insert_stmt,-1, &statement, NULL);
        if (sqlite3_step(statement) == SQLITE_DONE)
        {
            sqlite3_finalize(statement);
            sqlite3_close(database);
            return YES;
        }
        else
        {
            sqlite3_reset(statement);
            sqlite3_close(database);
            return NO;
        }
    }
    sqlite3_close(database);
}
return YES;

**Note:**Size of sqlite page cache is increasing upto 650MB

Aucun commentaire:

Enregistrer un commentaire