Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gson is not threadsafe #63

Closed
GoogleCodeExporter opened this issue Mar 19, 2015 · 4 comments
Closed

Gson is not threadsafe #63

GoogleCodeExporter opened this issue Mar 19, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

Gson throws ConcurrentModificationException when used concurrently. 
See the discussion in http://groups.google.com/group/google-
gson/browse_thread/thread/563bb51ee2495081


Original issue reported on code.google.com by inder123 on 20 Oct 2008 at 6:28

@GoogleCodeExporter
Copy link
Author

I add a test for this in r274

Original comment by inder123 on 20 Oct 2008 at 7:49

@GoogleCodeExporter
Copy link
Author

The culprit is ObjectNavigatorFactory which holds the memory stack reference. 
This 
stack must be held per call, not throughout the lifetime of Gson.

Original comment by inder123 on 20 Oct 2008 at 7:49

@GoogleCodeExporter
Copy link
Author

Fixed in r276

Original comment by inder123 on 20 Oct 2008 at 8:11

  • Changed state: Fixed

@aarengee
Copy link

The perfomance hit might be an issue for us so we resorted to using an overrride by using our own Serde for util.date and sql.date.

Uses FastDateFormat instead of SimpleDateFormat to ensure you dont take a performance hit due to serial usage (synchronize write and read)

Have added some sample code in github gist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants