{"action":"created","issue":{"url":"https://api.github.com/repos/requery/requery/issues/54","repository_url":"https://api.github.com/repos/requery/requery","labels_url":"https://api.github.com/repos/requery/requery/issues/54/labels{/name}","comments_url":"https://api.github.com/repos/requery/requery/issues/54/comments","events_url":"https://api.github.com/repos/requery/requery/issues/54/events","html_url":"https://github.com/requery/requery/issues/54","id":142902891,"number":54,"title":"Reinit database question","user":{"login":"miomao656","id":6882632,"avatar_url":"https://avatars.githubusercontent.com/u/6882632?v=3","gravatar_id":"","url":"https://api.github.com/users/miomao656","html_url":"https://github.com/miomao656","followers_url":"https://api.github.com/users/miomao656/followers","following_url":"https://api.github.com/users/miomao656/following{/other_user}","gists_url":"https://api.github.com/users/miomao656/gists{/gist_id}","starred_url":"https://api.github.com/users/miomao656/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miomao656/subscriptions","organizations_url":"https://api.github.com/users/miomao656/orgs","repos_url":"https://api.github.com/users/miomao656/repos","events_url":"https://api.github.com/users/miomao656/events{/privacy}","received_events_url":"https://api.github.com/users/miomao656/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/requery/requery/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-23T09:02:45Z","updated_at":"2016-03-24T14:17:10Z","closed_at":null,"body":"We initialize datastore like this:\r\n\r\n```\r\n      DatabaseSource source = new DatabaseSource(context, Models.CDGENERAL, GENERAL_DB, 1);\r\n      Configuration configuration = source.getConfiguration();\r\n      generalDataStore = new EntityDataStore<>(configuration);\r\n```\r\n\r\nWhen we log out user from app, database is deleted and we call `generalDataStore.close() `\r\n\r\nAfter new user logs in again we reinitialize EntityDataStore the same way as above and on first call generalDataStore.select we get this exception. \r\n\r\n```\r\nio.requery.PersistenceException: closed\r\nW:     at io.requery.sql.EntityDataStore.checkClosed(EntityDataStore.java:498)\r\nW:     at io.requery.sql.EntityDataStore.select(EntityDataStore.java:387)\r\n```\r\n\r\nHow to properly reinitialize datastore again in runtime? "},"comment":{"url":"https://api.github.com/repos/requery/requery/issues/comments/200857633","html_url":"https://github.com/requery/requery/issues/54#issuecomment-200857633","issue_url":"https://api.github.com/repos/requery/requery/issues/54","id":200857633,"user":{"login":"npurushe","id":4143434,"avatar_url":"https://avatars.githubusercontent.com/u/4143434?v=3","gravatar_id":"","url":"https://api.github.com/users/npurushe","html_url":"https://github.com/npurushe","followers_url":"https://api.github.com/users/npurushe/followers","following_url":"https://api.github.com/users/npurushe/following{/other_user}","gists_url":"https://api.github.com/users/npurushe/gists{/gist_id}","starred_url":"https://api.github.com/users/npurushe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npurushe/subscriptions","organizations_url":"https://api.github.com/users/npurushe/orgs","repos_url":"https://api.github.com/users/npurushe/repos","events_url":"https://api.github.com/users/npurushe/events{/privacy}","received_events_url":"https://api.github.com/users/npurushe/received_events","type":"User","site_admin":false},"created_at":"2016-03-24T14:17:10Z","updated_at":"2016-03-24T14:17:10Z","body":"Great!"}}