Results 1 to 2 of 2

Thread: Mongo - Query object: why are sort() & fields() synchronized?

  1. #1
    Join Date
    Dec 2008
    Location
    Aurora, CO, USA
    Posts
    24

    Default Mongo - Query object: why are sort() & fields() synchronized?

    In the Query Object, why do the sort() and fields() methods synchronize on this?

    On first read, it looks like this class is not thread-safe, since the criteria are stored in a LinkedHashMap, and the addCriteria() method is not synchronized.

    So why are we incurring the overhead of synchronization on these 2 methods?

  2. #2
    Join Date
    Dec 2008
    Location
    Aurora, CO, USA
    Posts
    24

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •