Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-5501

Make Criteria immutable after load_async is called

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      In https://jira.mongodb.org/browse/MONGOID-5445, asynchronous query execution was implemented.

      When a Criteria object is flagged for async execution, it may begin executing immediately. Modifying the object further (e.g. by adding conditions) could result in the actual query both respecting these modifications and ignoring them, depending on how the threads are scheduled.

      Ideally modifications of the Criteria object should be disallowed after load_async is invoked.

      AR does not disallow modifying criteria either, leaving it up to the user to ensure correct operation.

            Assignee:
            Unassigned Unassigned
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: