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

Remove synchronized(this) from sort() and fields() methods in the Query class [DATAMONGO-305] #1236

spring-projects-issues opened this issue Oct 26, 2011 · 0 comments
in: core type: enhancement


Copy link

spring-projects-issues commented Oct 26, 2011

Adam Rinehart opened DATAMONGO-305 and commented

In the class, the sort() and fields() methods are synchronizing on this, before initializing and returning the sort and fields attributes.

But in addCriteria(), it is making unsynchronized access to a LinkedHashMap to store the criteria in. Because of this, it seems like this class is not intended to be thread-safe.

Using synchronized in a class that is not thread-safe can cause a performance bottleneck, and should be removed

Affects: 1.0 M5

Reference URL:


Referenced from: commits b26bb62

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
in: core type: enhancement
None yet

No branches or pull requests

2 participants