Synchronizing db calls
I have a database schema where i am loading a bunch of clients from a
server with data such as first name, last name and id into my db when the
app starts. THis data is then displayed in a list format to the user. I
have another tab in my app that switches to a view which shows the client
list sorted by id into sections similar to the people app with section
headers. The trouble is, the user can switch to the sorted list tab
immediately upon startup and that list relies on the db already being
populated with client objects. It would be making a query on an empty db
if the user switches immediately. Is there any way to block that call
until the db is fully loaded with the client data? I know java has
synchronized methods, so can i sync on the db query or do anything like
that?
No comments:
Post a Comment