tags:

views:

304

answers:

1

Hi,

I've got a problem in my database - somehow changes sometimes are not being autocommitted so I need to COMMIT the manually.

How can I do this? What code do I have to write in objective-C in order to commit changes in SQLite?

I am developing an iPhone application.

Thanks.

+1  A: 

As I just happened to write to another question, the simplest way is:

char* errmsg;
int result = sqlite3_exec(database, "COMMIT", NULL, NULL, &errmsg);

with the usual result codes &c (you'll need to sqlite3_free(errmsg) after you've used the error message it points to, if any).

Alex Martelli