second ajax request getting locked.


I have a page which sends two different ajax request to the controller one after the other. However, the second request doesn't gets processed unless the controller finishes with the first request, i.e. to say the response of the first request is not delivered.

I have checked in firebug that both the requests are sent but , only when the response from first is received the second request is processed.

Is it supposed to be like this? I think there's something wrong. What I suspect is that the thread gets locked unless the first request is completed and hence the second request is queued till that time.

I am calling two different methods on the same underlying model objects in these two requests.

If this is a correct behavior can anyone please tell how to let the two threads access the object at the same time.

I have not synchronized or made any thread safe model objects.

Thanks, Shishir

the controller is single threaded - it is supposed to be like that- the second request is queued until the first request is processed. however you can hit a different controller - because individual controllers can process requests or end up using fork() to allow further request processing

I have tried hitting different controller by moving my method in that , anticipating that there will be a new thread, but in vain, because it still waits for the first request to complete. The problem somehow seems to be the concurrent access to the model object by these two different requests.

Is it correct that the underlying model object can only be accessed by one controller at a time.?? Is there some configuration I need to set.?