{"action":"created","issue":{"url":"https://api.github.com/repos/ejurgensen/forked-daapd/issues/110","labels_url":"https://api.github.com/repos/ejurgensen/forked-daapd/issues/110/labels{/name}","comments_url":"https://api.github.com/repos/ejurgensen/forked-daapd/issues/110/comments","events_url":"https://api.github.com/repos/ejurgensen/forked-daapd/issues/110/events","html_url":"https://github.com/ejurgensen/forked-daapd/pull/110","id":59094486,"number":110,"title":"Enclose DB upgrade in a single transaction ","user":{"login":"chme","id":1037620,"avatar_url":"https://avatars.githubusercontent.com/u/1037620?v=3","gravatar_id":"","url":"https://api.github.com/users/chme","html_url":"https://github.com/chme","followers_url":"https://api.github.com/users/chme/followers","following_url":"https://api.github.com/users/chme/following{/other_user}","gists_url":"https://api.github.com/users/chme/gists{/gist_id}","starred_url":"https://api.github.com/users/chme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chme/subscriptions","organizations_url":"https://api.github.com/users/chme/orgs","repos_url":"https://api.github.com/users/chme/repos","events_url":"https://api.github.com/users/chme/events{/privacy}","received_events_url":"https://api.github.com/users/chme/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-26T16:07:54Z","updated_at":"2015-02-27T22:18:15Z","closed_at":"2015-02-27T22:17:08Z","pull_request":{"url":"https://api.github.com/repos/ejurgensen/forked-daapd/pulls/110","html_url":"https://github.com/ejurgensen/forked-daapd/pull/110","diff_url":"https://github.com/ejurgensen/forked-daapd/pull/110.diff","patch_url":"https://github.com/ejurgensen/forked-daapd/pull/110.patch"},"body":"A db upgrade can take very long and in case of an error leaves the db in an invalid state (partially updated). This can be improved by doing the update in a single transaction. If an error during the update occurs the whole changes will be rolled back. \r\n\r\nThe performance gain depends on the number of queries that are executed during the update. In case of the upgrade from 15.1 to 16.0, this is quite significant as each row in the files and playlist table is updated.\r\n\r\nBecause of the update being part of the db init, db locking is not an issue (there are no other threads that will access the db during the initialization)."},"comment":{"url":"https://api.github.com/repos/ejurgensen/forked-daapd/issues/comments/76483139","html_url":"https://github.com/ejurgensen/forked-daapd/pull/110#issuecomment-76483139","issue_url":"https://api.github.com/repos/ejurgensen/forked-daapd/issues/110","id":76483139,"user":{"login":"ejurgensen","id":1156686,"avatar_url":"https://avatars.githubusercontent.com/u/1156686?v=3","gravatar_id":"","url":"https://api.github.com/users/ejurgensen","html_url":"https://github.com/ejurgensen","followers_url":"https://api.github.com/users/ejurgensen/followers","following_url":"https://api.github.com/users/ejurgensen/following{/other_user}","gists_url":"https://api.github.com/users/ejurgensen/gists{/gist_id}","starred_url":"https://api.github.com/users/ejurgensen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ejurgensen/subscriptions","organizations_url":"https://api.github.com/users/ejurgensen/orgs","repos_url":"https://api.github.com/users/ejurgensen/repos","events_url":"https://api.github.com/users/ejurgensen/events{/privacy}","received_events_url":"https://api.github.com/users/ejurgensen/received_events","type":"User","site_admin":false},"created_at":"2015-02-27T22:18:15Z","updated_at":"2015-02-27T22:18:15Z","body":"Looks good, thanks!"}}