Use of Java synchronized at the server, on dispatchers execute methods?

25 views
Skip to first unread message

Fille

unread,
May 12, 2012, 5:55:21 AM5/12/12
to gwt-pl...@googlegroups.com
I just realize when I press a button many times fast in the UI for fetching data from the server, I get redundant result. From race condition i guess.

Should i add "synchronized" on the execute method's on the server. Or should i use some client mechanism?

What do you think is the best solution?

Regards
Fille

Carlos Alexandro Becker

unread,
May 12, 2012, 10:15:03 AM5/12/12
to gwt-pl...@googlegroups.com
I usually put the button in a disabled state while doing a request.

Ümit Seren

unread,
May 13, 2012, 9:09:13 AM5/13/12
to gwt-pl...@googlegroups.com
I guess to be on the safe side you should do both. 
Disable the button and synchronize on the backend.

Fille

unread,
May 13, 2012, 9:52:17 AM5/13/12
to gwt-pl...@googlegroups.com
Allright, thanks!

I'll stick with synchronized on the server and add the functionality with disabled buttons.

Regards
Fille
Reply all
Reply to author
Forward
0 new messages