Atma
Atma

Reputation: 29785

REST request times out after making several database connections

I have a REST application that uses RESTlets. I am querying several databases to create a response with the queried data. The process of closing and opening database connections takes sometimes 20 seconds each. Sometimes my procedure makes 10 different database connections (to different databases). The browser times out after this time because this is obviously too long for a client to wait for the response.

How can I retrieve data from these different databases in a single batch without getting this time out. How can I speed up this process to be under the timeout threshold of the browser?

Upvotes: 0

Views: 110

Answers (1)

Atma
Atma

Reputation: 29785

I ended up implementing memcached with a long timeout. Now I only do this extensive query once and it is cached for several hours.

Upvotes: 1

Related Questions