I want to create some methods to begin, commit or rollback a transaction in Xcode.
I want to know which methods of sqlite3 library I have to use.
Is it OK to use sqlite3_prepare_v2?
Or sqlite3_readonly_stmt?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can do that by executing the following self-explanatory commands in SQLite:
begin immediate transaction,commit transactionandrollback transaction.Note: I’ve used the
immediatetransaction behavior. For information about it and the other ones (deferred,exclusive), take a look here.To execute the command in Objective-C, use this (where
sqlcontains one of the above commands as anNSString; anddbis your database handle –sqlite3*):