Skip to content
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

Persist data with Room - wrong implementation of singleton initialization #122

Open
Yonathan-Ashebir opened this issue Jun 18, 2024 · 0 comments

Comments

@Yonathan-Ashebir
Copy link

URL of codelab

I have noticed what possibly could be an issue on STEP 7 of the code lab.
image

At the end of this step (as shown in the screen shot), the code to create the database checks nullness of Instance in non-synchronized manner and it is after that it enters to the synchronized block to initialize it. Does not this create a race condition and allow re-initialization of the database? OR is this an acceptable behaviour when it comes to ROOM?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant