-
Notifications
You must be signed in to change notification settings - Fork 197
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
[BUG] Calling store.get() in RoomDatabase.withTransaction will encounter a deadlock #453
Comments
Thank you for reporting and including a sample ❤️. I can take a look this week and let you know a fix/suggestion. My initial thinking is the transaction is locking writing to the db within your block. Without writing we can't read. |
This looks related. https://issuetracker.google.com/issues/120854786 |
Do you mind trying the new transaction api and reporting back if it works? |
Thanks for your fast reply. The |
I find out that the KDoc of |
I'm going to keep this issue open as we are currently rewriting some store internals for a Store5 major release. Let me think about how to solve this in a generic manner. |
Describe the bug
When I call
store.get()
in theRoomDatabase.withTransaction {}
and the store trigger the writer to write data into the database, a deadlock will occur. Everything is fine if the writer does not trigger or calling thestore.get()
outside thewithTransaction {}
.To Reproduce
store.get()
inside theRoomDatabase.withTransaction {}
Sample code (Full sample):
Expected behavior
Smartphone (please complete the following information):
The text was updated successfully, but these errors were encountered: