question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android room database - LiveData paging slow appear when a lot of insert/update into database

See original GitHub issue

I’m working in a project realtime with LiveData and Paging database I meet the issue: – My list take long time to appear when have a lot of insert/update to database.

val viewModel = ViewModelProviders.of(this).get(MyViewModel::class.java) viewModel.init(database) viewModel.getUserList()?.observe(this, Observer { println("load paging :::: ${it?.size}") })

could anybody help me

Thank you so much. Hieu Tran

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:20 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
NhatPham94commented, Sep 12, 2018

@tvhieuit Currently I’m working on a demo with Paging lib + Room + LiveData, I trigger updates and try to debug and see what’s going on. The result is Room only loads specific number of items follow what I’ve config with Paging lib (ex : page size) instead of re-create the whole query

1reaction
NhatPham94commented, Sep 6, 2018

I think that Room (+LiveData) will re-query for every updates so it’s causing slow when have a lot of insert/update

Read more comments on GitHub >

github_iconTop Results From Across the Web

LiveData paging slow appear when a lot of insert/update ...
I use LiveData to my project without room, I find when I change database the ui update very slow. It's there a good...
Read more >
Lag in displaying data from Oberver on LiveData
Adapter, and loads data from LiveData from my Room database. The problem is that my display is always blank, and checking with the...
Read more >
Write asynchronous DAO queries
DAO queries fall into three categories: One-shot write queries that insert, update, or delete data in the database. One-shot read queries that ...
Read more >
7 Pro-tips for Room
In this article, I'd like to share some pro-tips on getting the most out of Room: Pre-populate your database via RoomDatabase#Callback ...
Read more >
Exception while computing database live data - Visible to Public
P2, Android room database - LiveData paging slow appear when a lot of insert/update into database. “ https://issuetracker.google.com/134685570 ”.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found