Re: Client issues an RPC before another RPC has finished
Hmm, I do use MVP and I switched to Activity&Places on another project, still using a home grown Presenter+Viewer framework on this project.
My AppController creates a presenter each time for a new location:
new ViewPresenter(clientFactory).go(container);
The presenter may issue: clientFactory.getRpcService().execute(...)
But when a user navigates to another location the presenter is probably not destroyed
The new location would do: new View2Presenter(clientFactory).go(container)
And the 1st presenter would get destroyed only when the 1st location is revisited. That is when the view.presenter variable is reset.
Hmm, I need to think about this more.
Or maybe I should simply enable the Activity/Places framework for this project also.
Thank you
On Saturday, November 24, 2012 8:05:14 AM UTC-8, Supercobra Thatbytes wrote:
If you use an MVP pattern this should solve your problem. In this pattern RPCs are issued from the Presenter (Activity in GWT). Each time a user changes Place (URL) the current Activity is destroyed and a new one is created by the new Place for the new view. RPC callbacks that point to the old Activity are discarded silently.More about places and activities in GWT:https://developers.google.com/web-toolkit/doc/latest/ DevGuideMvpActivitiesAndPlaces
On Friday, November 23, 2012 12:04:13 PM UTC-6, Alexey Panteleev wrote:Hello,I've been struggling with this issue for a long time, maybe someone could help me address this finally?From time to time it happens that a user navigates to one page wich issues an RPC to our server but then quickly navigates to another page which issues yet another RPC to the server while the 1st call is still being processed by the server. In this case I always see some kind of SQLException on the server side (I guess for the 1st call) and then the client also receives an unspecified Exception.What is the best practice for dealing with these situations? Should I be canceling the 1st call before allowing the 2nd one?We use gwt-dispatch, I did not find a cancel method in that framework yet. Or should I not allow any new calls until the active one has not finished?Do you ever run into this w/ GWT?Thanks much,Alexey
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/8GOIb5Bv-BYJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home