I would like some ideas of how to handle this kind of situations.
I run a few SQL queries to a remote server. (this is part of a sync routine)
The values that result from this queries are needed for the rest of the app to continue.
I've tried to run the queries in the activity itself or as a service.
Some time works perfectly but occasionally the program flow continues and when the data is needed, it still is not available (although it comes up a little later)...but then...its too late
So...I need to wait, to ensure that all queries have been processed and all jobs terminated. Something like raising an event and only then the app is ready to continue as I know that without the data from the queries it will faill.
I also tried CallSubDelayed...but occasionally the same kind of problem happens. It seems to depend if the server is a little busier or data amount is higher, etc.
I know that some people had issues with this kind of things, and I'm still extremely confused on the approach to handle this kind of situations.
All help will be welcomed. Some sort of tutorial or whatever you guys can throw me so that I can understand how to handle this kind of situations.
many thanks
José
By the way, I also tryed the idea of
..same result..the data ocasionaly arrives too late.
I run a few SQL queries to a remote server. (this is part of a sync routine)
The values that result from this queries are needed for the rest of the app to continue.
I've tried to run the queries in the activity itself or as a service.
Some time works perfectly but occasionally the program flow continues and when the data is needed, it still is not available (although it comes up a little later)...but then...its too late
So...I need to wait, to ensure that all queries have been processed and all jobs terminated. Something like raising an event and only then the app is ready to continue as I know that without the data from the queries it will faill.
I also tried CallSubDelayed...but occasionally the same kind of problem happens. It seems to depend if the server is a little busier or data amount is higher, etc.
I know that some people had issues with this kind of things, and I'm still extremely confused on the approach to handle this kind of situations.
All help will be welcomed. Some sort of tutorial or whatever you guys can throw me so that I can understand how to handle this kind of situations.
many thanks
José
By the way, I also tryed the idea of
B4X:
Select Job.JobName
Case "JobA"
'handle jobA
'Submit JobB
Case "JobB"
'handle JobB
'Submit JobC
Case "JobC"
'Handle JobC
End Select
..same result..the data ocasionaly arrives too late.
Last edited: