-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I want to load some big data from DB. I use MVVM. So how i can load data in background and then notify user that data is loading. Can i use other thread? And i need that UI doesn't stop working during loading.
Sentinel,
You have several options.
You could use caching for the data.
This means of course more memory usage.
Option 2, is like caching but manual :
Define a "cron job" that is triggered each x time.
Put the data in the application scope.
When you need it, get it from the application scope.
Otherwise you have trigger an asynchoneous task in the background.
This topic of Dzone can guide you with it.
You have to see what option is best for you. (lot of usage of the big data I would go for caching, less needs => async task).
Of course it also depends on when you need your data. Is it when you are on one specific page, or must it always be available.
Greetz chill.
Hello sentinal, you don't specify what type of data you want to load and where you want to show if really you want to show. for example if you want to show data in a grid i think is not good to load many data once, you can use paging for example. Now if you want to load for save on file is a different type of approach...
i think you could use something like this: upload_effect
Im recomending upload_effect
Asked: 2014-06-20 09:25:56 +0800
Seen: 35 times
Last updated: Jul 01 '14
I load objects from DB using Hibernate. I need to calculatre then some statistic and show this object using grid. But first i need to load all object from db in memory. I need that whyle people in main page see some general information, this data load in background.
sentinal ( 2014-06-21 07:16:52 +0800 )edit