Hi, 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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 On Sep 25, 9:40 am, Shishir Srivastava <shishir.srivast...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > 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--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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.? ~Shishir On Sep 26, 8:56 am, shashiprab <shaship...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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 > > On Sep 25, 9:40 am, Shishir Srivastava <shishir.srivast...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > Hi, > > > 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--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---