Click here to Skip to main content
15,558,352 members
Please Sign up or sign in to vote.
1.44/5 (2 votes)
See more:
While Development of one of My Project I was in need to continuously check Status of database value for that I need to call background service .

I was using XMLHTTPREquest that call web service(has database logic).

but I was facing that after some period of time it stop calling background service .

unable to find issue,any body know why this is so?
Posted
Updated 30-Dec-15 20:24pm
v2
Comments
Anurag Gandhi 31-Dec-15 1:26am    
Can you please provide the code which you are using to call the web service?
Did you use setTimeout?
Sergey Alexandrovich Kryukov 31-Dec-15 1:47am    
First of all, what you described is not "recursion".
—SA
Dhruti90 31-Dec-15 2:16am    
I am talking about Embeded System related coding .

Like fetching machine on off status continuously.if there are multiple user working together at a time.then its necessary to have real time status to every user.

For that recursion to use ,isn't it?
Sinisa Hajnal 31-Dec-15 2:35am    
Recursion means that the method you call calls itself at some point. You probably mean recurrent (repeating).

Most likely the system got stuck at one call (for whatever reason) and then the next one couldn't access the resource and exited the loop. This could be because round trip to the database took longer then your timed trigger.
ZurdoDev 31-Dec-15 15:58pm    
1. I suggest using .ajax() in jquery instead of the manual way of doing it. The browsers have restrictions of how it works and the jquery library handles it correctly.
2. Make sure to be using setTimeout() and have a delay between each call. If you are continually running scrip then the browser will kill it after some time.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900