Thursday, December 12, 2013

Re: Getting ConcurrentModificationException

Thanks a lot for your help. 
We are able to reproduce this issue by updating hashmap while sending event.
Now we'll add generic solution for all events to send copy of hashmap in event.

Regards,
Vikas

On Wednesday, December 11, 2013 8:18:11 PM UTC+5:30, Jens wrote:
On server side GWT does not spawn any threads on its own. Everything is executed in the thread that handles the client request. Also GWT's Map serializer is stateless, see: https://gwt.googlesource.com/gwt/+/master/user/src/com/google/gwt/user/client/rpc/core/java/util/Map_CustomFieldSerializerBase.java

So if you sometimes have ConcurrentModificationExceptions then I am pretty sure (99%) that you have somewhere a HashMap instance lying around that gets modified while being serialized. I could imagine that you have a HashMap somewhere stored in a field and want that HashMap to be pushed to all clients once it gets modified. In that case you need to create a copy of that map before pushing it to the client.

It's irrelevant if you push things one by one (single thread executor). If the map in question gets modified while a single push is in progress you will get the exception.

Check your Map usages on the server.

-- J.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate