Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID
Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.

problem in database update sometimes

prathibhaprathibha Posts: 83Registered Users
HI,
I had created the database i.e., sqlite database ... i had added the method to update the column using the following code

//Set the encrypted key
-(void)SetEncryptedKey:(NSData*)key
{
int sqlite3_busy_timeout(sqlite3*, int ms);

int a = sqlite3_busy_timeout(db, 10000000);
NSLog(@" a = %i",a);

char* err;
NSString *keystring = [[NSString alloc]initWithData:key encoding:NSASCIIStringEncoding];
NSString *sql = [NSString stringWithFormat:@"update ApplicationContext set Encryptedkey = '%@' ",keystring ];

NSLog(@"sqlite3_exec(db, [sql UTF8String], NULL, NULL, &err) is %i",sqlite3_exec(db, [sql UTF8String], NULL, NULL, &err));

if(sqlite3_exec(db, [sql UTF8String], NULL, NULL, &err) != SQLITE_OK)
{
sqlite3_close(db);
NSAssert(0, @"TABL FAILED TO UPDATE ENCRYPTED KEY");
}

sqlite3_finalize(addStmt);

}

but sometimes it will crash saying sigabrt @ this line NSAssert(0, @"TABL FAILED TO UPDATE ENCRYPTED KEY");

and NSLog(@"sqlite3_exec(db, [sql UTF8String], NULL, NULL, &err) is %i",sqlite3_exec(db, [sql UTF8String], NULL, NULL, &err)); value is 1 it is coming...
It comes only few times //// please any one tell me what is my mistake?
Sign In or Register to comment.