Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Thu May 25, 2017 9:30 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: APP stall/lock when a sub/fun requires a long execution time
PostPosted: Thu May 23, 2013 5:34 am 
Offline

Joined: Tue Oct 25, 2011 4:28 am
Posts: 54
hi, i have this problem,
i have a webpage with a webListbox.
in action of webButtonA i call subPopulateListbox
this sub, retrieve a lot of records from mysql db (mysql is on the same pc)
number of records retrieved are approximately 5000
the sub employ 10/20 seconds and in this time populate the webListBox.
if i am in the same network all work fine, if i am out of network (and launch the application
from outside ) when the app call subPopulateListbox the app seems locked and the client browser is in stall.
if i connect to the server with RDP when run subPopulateListbox i see in the task manager that the app use 98%
of cpu for a lot of seconds, then the cpu use go to normal index like 3 to 10% , but the client browser is lock/stall..??
i know that i use a webTimer to launch subPopulateListbox but i think that is not the best system...
can anyone help me ????
tnx ......


Top
 Profile  
 
 Post subject: Re: problem with sub/function that require a long execution
PostPosted: Thu May 23, 2013 6:52 am 
Offline
User avatar

Joined: Thu Aug 26, 2010 6:57 am
Posts: 569
Location: Sydney Australia
Can you paginate the data or restrict it by adding search functionality?
I cant imagine you need 5000 records at a time.

Try using SQL's limit to restrict returned records

SELECT * FROM `your_table` LIMIT 0, 10
'This will display the first 10 results from the database.
SELECT * FROM `your_table` LIMIT 5, 5
'This will show records 6, 7, 8, 9, and 10


Or "LIKE" to return records that are like text a user puts in a text field

SELECT * FROM `your_table` WHERE somevalue LIKE '%mytextfield.text%'
'This will return a limited recordset

_________________
Regards

Chris Musty
http://www.specialised.net.au
-----------------------------------------------
if date.shortdate >= 4/6/2013 then
msgbox "I am using Xojo - YAY!!!"
else
msgbox "I am still using RS 12r2.1 - BOO!!!"
end if

Win 8 Pro, Ubuntu 13.04, Mint and Debian(gnome and KDE)
AWS for Hosting and TKL for AMI's


Top
 Profile  
 
 Post subject: Re: APP stall/lock when a sub/fun requires a long execution
PostPosted: Thu May 23, 2013 7:08 am 
Offline

Joined: Tue Oct 25, 2011 4:28 am
Posts: 54
yes i can restrict... i can show a lot of records... i can use webTimer ... etc etc
but this is a lot of code that i must write !!! (if rs work fine i don't need escamotage/retraction!)
my first ask is ...
why in lan this work fine and from wan not...?? (the reply will be LATENCY)
other my ask is ...
i use rsWeb because programming must be simple for me ?? or i must complete with code the problems or
unmanaged and undocommented bugs of RS web Edition ???
tnx to all.


Top
 Profile  
 
 Post subject: Re: APP stall/lock when a sub/fun requires a long execution
PostPosted: Sat May 25, 2013 12:24 am 
Offline
User avatar

Joined: Thu Aug 26, 2010 6:57 am
Posts: 569
Location: Sydney Australia
You can't get any more simple than "LIMIT 0,50" appended to an SQL statement!

_________________
Regards

Chris Musty
http://www.specialised.net.au
-----------------------------------------------
if date.shortdate >= 4/6/2013 then
msgbox "I am using Xojo - YAY!!!"
else
msgbox "I am still using RS 12r2.1 - BOO!!!"
end if

Win 8 Pro, Ubuntu 13.04, Mint and Debian(gnome and KDE)
AWS for Hosting and TKL for AMI's


Top
 Profile  
 
 Post subject: Re: APP stall/lock when a sub/fun requires a long execution
PostPosted: Sat May 25, 2013 2:07 am 
Offline

Joined: Wed Mar 22, 2006 11:15 am
Posts: 712
Location: Southern California
gecomail wrote:
my first ask is ...
why in lan this work fine and from wan not...?? (the reply will be LATENCY)


I don't understand: you know the reply, yet you believe that WE should be able to instantly load 5,000 records into a WebListBox any way?

Quote:
i use rsWeb because programming must be simple for me ?? or i must complete with code the problems or
unmanaged and undocommented bugs of RS web Edition ???


How is network latency a WE bug?

Network dependent lists and grids do not load everything at once for a reason, and that reason is the same regardless of language. Paginate your database results into something that the network and web browser can manage.

_________________
Daniel L. Taylor
Custom Controls for Real Studio WE!
Visit: http://www.webcustomcontrols.com/


Top
 Profile  
 
 Post subject: Re: APP stall/lock when a sub/fun requires a long execution
PostPosted: Sat May 25, 2013 3:14 am 
Offline

Joined: Tue Oct 25, 2011 4:28 am
Posts: 54
ok, no i don't know the solution of the problem "...why in lan this work fine and from wan not...??"
but i think that "latency" is most used replication to justify a lot of problem that i have meet in rsWeb.

and i don't think that rs must be capable to fill grid(webListBox) ".... at once "
but i think/believe that webApp must no lock/stall if the operation (like retrive some records) employ long time...
the app must wait the end of the operation then must resume his operation normally.
in my first post i try to say this :
my app that have a webListBox has a sub that retrieve for example 5000 records and fill the webListBox with this records.
When i use this app from wan, i check what happens on the pc where run this webApp with windows task manager..,
and i see that for a lot time webApp and mysqlDaemon uses much %CPU (98%), than the use of cpu back to normal levels.. (2%).
I think that when %CPU is hight the webApp can be slowed (like locked) but when %CPU back to normal level (in this case
the sub that retrieve records and fill webListBox has terminate his execution) the webApp must come back to respond and
not result locked/stalled.
the latency must no lock/stall my webApp.!!!
Then i can create code for manage this problem but this is not a recognized/documented problem of rsWeb edition...

(sorry for my bad english but i don't know this language)


Top
 Profile  
 
 Post subject: Re: APP stall/lock when a sub/fun requires a long execution
PostPosted: Sat May 25, 2013 4:50 am 
Offline

Joined: Wed Mar 22, 2006 11:15 am
Posts: 712
Location: Southern California
gecomail wrote:
but i think that "latency" is most used replication to justify a lot of problem that i have meet in rsWeb.


Latency/bandwidth is the most likely reason why a large data transfer that works over LAN would fail over WAN/Internet.

Quote:
but i think/believe that webApp must no lock/stall if the operation (like retrive some records) employ long time...


Breaking tasks down into pieces to avoid locking up the UI, desktop or web, is not something the compiler can automatically do for you. You have to look at your code and decide how to do that. In this case it's pretty easy. Do one or both of the following:

* Display subgroups of records, say 100 per group, and give the user some way to navigate the groups.
* Load the WebListBox using a WebTimer.

BTW, I would bet the WE app is not locking up, which you can test by opening another connection in a separate browser. The browser itself (or browser window/tab) is likely locked while waiting to receive data and complete its work. JavaScript is not multithreaded.

Quote:
I think that when %CPU is hight the webApp can be slowed (like locked) but when %CPU back to normal level (in this case the sub that retrieve records and fill webListBox has terminate his execution) the webApp must come back to respond and not result locked/stalled.


Just because the web app's CPU usage has dropped doesn't mean that the network transfer is complete, the client side JavaScript execution is complete, or that the browser's HTML rendering is complete.

Quote:
the latency must no lock/stall my webApp.!!!


WAN speeds are a fraction of LAN speeds, and the client side framework can't do much until it has all of the data.

Quote:
Then i can create code for manage this problem but this is not a recognized/documented problem of rsWeb edition...


It's a recognized problem for all web languages. If you were using something else, say straight PHP and JavaScript, you would have to take similar steps.

_________________
Daniel L. Taylor
Custom Controls for Real Studio WE!
Visit: http://www.webcustomcontrols.com/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group