{"action":"created","issue":{"url":"https://api.github.com/repos/yesodweb/persistent/issues/518","labels_url":"https://api.github.com/repos/yesodweb/persistent/issues/518/labels{/name}","comments_url":"https://api.github.com/repos/yesodweb/persistent/issues/518/comments","events_url":"https://api.github.com/repos/yesodweb/persistent/issues/518/events","html_url":"https://github.com/yesodweb/persistent/issues/518","id":122050467,"number":518,"title":"split PersistStore to distinguish between read-only and read-write access to database","user":{"login":"vandenoever","id":608417,"avatar_url":"https://avatars.githubusercontent.com/u/608417?v=3","gravatar_id":"","url":"https://api.github.com/users/vandenoever","html_url":"https://github.com/vandenoever","followers_url":"https://api.github.com/users/vandenoever/followers","following_url":"https://api.github.com/users/vandenoever/following{/other_user}","gists_url":"https://api.github.com/users/vandenoever/gists{/gist_id}","starred_url":"https://api.github.com/users/vandenoever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vandenoever/subscriptions","organizations_url":"https://api.github.com/users/vandenoever/orgs","repos_url":"https://api.github.com/users/vandenoever/repos","events_url":"https://api.github.com/users/vandenoever/events{/privacy}","received_events_url":"https://api.github.com/users/vandenoever/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-14T14:13:24Z","updated_at":"2015-12-14T16:46:47Z","closed_at":null,"body":"PersistStore can read and write to a database. Some use-cases can be safer with a read-only handle to the database. Additionally, a backend like Sqlite can benefit in it's concurrently from knowing if an access is for reading or writing. There can be many concurrent readers, but only one concurrent writer.\r\n\r\nA solution could be to split up PersistStore into PersistStore and PersistReadOnlyStore.\r\n\r\nThis distinction makes it possible to make a wrapper around Pool SqlBackend with a RWL.RWLock. Such a lock makes it possible to access sqlite without danger of a busy timeout.\r\n\r\nAlternatively, PRAGMA busy_timeout can be set to a high value."},"comment":{"url":"https://api.github.com/repos/yesodweb/persistent/issues/comments/164490864","html_url":"https://github.com/yesodweb/persistent/issues/518#issuecomment-164490864","issue_url":"https://api.github.com/repos/yesodweb/persistent/issues/518","id":164490864,"user":{"login":"gregwebs","id":1183,"avatar_url":"https://avatars.githubusercontent.com/u/1183?v=3","gravatar_id":"","url":"https://api.github.com/users/gregwebs","html_url":"https://github.com/gregwebs","followers_url":"https://api.github.com/users/gregwebs/followers","following_url":"https://api.github.com/users/gregwebs/following{/other_user}","gists_url":"https://api.github.com/users/gregwebs/gists{/gist_id}","starred_url":"https://api.github.com/users/gregwebs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregwebs/subscriptions","organizations_url":"https://api.github.com/users/gregwebs/orgs","repos_url":"https://api.github.com/users/gregwebs/repos","events_url":"https://api.github.com/users/gregwebs/events{/privacy}","received_events_url":"https://api.github.com/users/gregwebs/received_events","type":"User","site_admin":false},"created_at":"2015-12-14T16:46:47Z","updated_at":"2015-12-14T16:46:47Z","body":"Cool! Splitting up the typeclass should be easy enough. Properly using the correct connection is where things get interesting.  @pseudonom has done this with an extra layer but might be interested in driving some of this down into persistent itself."}}