{"action":"created","issue":{"url":"https://api.github.com/repos/ccgus/fmdb/issues/374","labels_url":"https://api.github.com/repos/ccgus/fmdb/issues/374/labels{/name}","comments_url":"https://api.github.com/repos/ccgus/fmdb/issues/374/comments","events_url":"https://api.github.com/repos/ccgus/fmdb/issues/374/events","html_url":"https://github.com/ccgus/fmdb/issues/374","id":75208277,"number":374,"title":"sqlite cannot commit,no transaction is active","user":{"login":"bill666500","id":10150383,"avatar_url":"https://avatars.githubusercontent.com/u/10150383?v=3","gravatar_id":"","url":"https://api.github.com/users/bill666500","html_url":"https://github.com/bill666500","followers_url":"https://api.github.com/users/bill666500/followers","following_url":"https://api.github.com/users/bill666500/following{/other_user}","gists_url":"https://api.github.com/users/bill666500/gists{/gist_id}","starred_url":"https://api.github.com/users/bill666500/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bill666500/subscriptions","organizations_url":"https://api.github.com/users/bill666500/orgs","repos_url":"https://api.github.com/users/bill666500/repos","events_url":"https://api.github.com/users/bill666500/events{/privacy}","received_events_url":"https://api.github.com/users/bill666500/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-11T12:39:50Z","updated_at":"2015-05-11T17:00:46Z","closed_at":"2015-05-11T16:05:36Z","body":"I used the following code ,but it dosen't work. And the xcode gave me the \" Error calling sqlite3_step (1: cannot commit - no transaction is active) SQLITE_ERROR DB Query: commit transaction\"\r\nFMDatabaseQueue *queue = [FMDatabaseQueue databaseQueueWithPath:path];\r\n [queue inDatabase:^(FMDatabase *db) {\r\n        //todo iOS sqlite cannot commit, no transaction is active\r\n         DLog(@\"result:%d\",[db executeUpdate:updateSql]);\r\n         [db commit];\r\n     }];\r\n"},"comment":{"url":"https://api.github.com/repos/ccgus/fmdb/issues/comments/100978901","html_url":"https://github.com/ccgus/fmdb/issues/374#issuecomment-100978901","issue_url":"https://api.github.com/repos/ccgus/fmdb/issues/374","id":100978901,"user":{"login":"robertmryan","id":1530768,"avatar_url":"https://avatars.githubusercontent.com/u/1530768?v=3","gravatar_id":"","url":"https://api.github.com/users/robertmryan","html_url":"https://github.com/robertmryan","followers_url":"https://api.github.com/users/robertmryan/followers","following_url":"https://api.github.com/users/robertmryan/following{/other_user}","gists_url":"https://api.github.com/users/robertmryan/gists{/gist_id}","starred_url":"https://api.github.com/users/robertmryan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertmryan/subscriptions","organizations_url":"https://api.github.com/users/robertmryan/orgs","repos_url":"https://api.github.com/users/robertmryan/repos","events_url":"https://api.github.com/users/robertmryan/events{/privacy}","received_events_url":"https://api.github.com/users/robertmryan/received_events","type":"User","site_admin":false},"created_at":"2015-05-11T17:00:46Z","updated_at":"2015-05-11T17:00:46Z","body":"No commit needed here as you have only one SQL statement. (SQLite will commit each SQL statement unless you begin a transaction and then commit it later.)\r\n\r\nBut if you wanted to use transactions (i.e. you had multiple SQL statements and wanted them committed together or rolled back together), you could either manually being a transaction and then commit them when done, or just use `inTransaction` rather than `inDatabase`.\r\n\r\nBut as Gus says, it makes no sense to commit a transaction without beginning one."}}