What is the right way of making continuous ajax calls? What is the right way of making continuous ajax calls? ajax ajax

What is the right way of making continuous ajax calls?


It looks like a server-side issue with too many connections to a database. How're you connecting to the DB? Are you closing the connection after using it? Try closing the connection after a number of connections.


"I get an error back from the server" makes me think this is a server side resource leak. What happens if you run two browser tabs in parallel, or two browsers in parallel, or two hosts with their own browsers hitting the server in parallel?

Does your browser memused rise over time?

If you have access to server side logs, that would also be a point to dive in.

EDIT

After seeing server code, you may want to close the reader as well for safety; I would be surprised if this caused a leak, but you never know. I'm more familiar with Java, where this can cause a leak depending on the underlying driver being used.

dr.Close();con.Close();