What is the best pratice to update webControls from inside a preemptive webThread

i have a webpage with a 4 webListBoxies
i need to show on each webListbox the contens of the recordset obtained form relative query.
each query can employ 30/120 seconds , each query restituites from 100…to 10.000 records
i would like encapsulate all queries in preempitve webThread and then populate the relative webListBoxies but, to prevent webapp crash (like as descrived in xojo documentation) i cant update/populate the webListboxies from inside of webThread.

i think that i can create 4 webpage’s rowset proprierties, elaborate query inside the preemptive webthread , then set these 4 webpage’s rowset with the 4 rowsets obtained inside the webThread, then i call a webpage’s method that will fill each weblistibox with relative rowset , but in this case the webListBox filling time will replase on the webapp’s mono thread and the result will be a slower gui and the problem will exapnd to all webapp’s users

any suggestion to fill the weblistboxies from inside the webThread ?
or any other way to do this activities ?

You can’t. The methods that the web framework calls are not thread safe (yet).

There’s also the problem of the data bottleneck. Remember, while you can populate the data quickly, it still needs to be downloaded to the users computer and that’s still relatively slow.

Remember that web listbox is lazy loading, so it only updates what the user browser for. You won’t get any benefit from your preemptive thread there anyway.

In other words, if i must show a considerabile quantity of records in a
x weblistboxies, if i can’t use webThread , i must accept that the webapp (monoThread) Will be freezed for current user and for all other users when the procedure
get data from db and when fills the weblistboxies ?

No, you should use the lazy-load mechanism and assign a DataSource.

2 Likes