-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added AbstractQuery.getDao() #345
base: master
Are you sure you want to change the base?
Conversation
Used to check if the dao database isn't already closed to validate a saved query object.
Sorry, don't want to expose that. One can always store the dao beforehand. |
@greenrobot Can you please explain why exposing the dao property would be a problem? Storing the dao alongside a saved query object, when the query object itself already has a reference to it would be a dirty solution to this problem. The problem that needs to be solved is being able to find out if a saved query object is referencing a database that has already been closed or not. Before attempting to reuse a saved query, this needs to be checked, as it's possible the database has been closed in our app. Invalidating all saved query objects upon closing the database is also a complicated solution, as we'd have to be sure to add every saved query reference to the database closing method, and it would be easy to forget when adding them later. It's much easier to make this check before attempting to reuse a query. Is there some other way you could propose knowing if a query object is still reusable with a currently opened database or if it is referencing a database which is no longer open? |
I was almost convinced, but |
That should work as well for this need, since ultimately it would be the dao session that would be gotten from the dao to perform this check.
|
Used to check if the dao database isn't already closed to validate a saved query object.
I've made the requested changes from |
Used to check if the dao database isn't already closed to validate a saved query object.