Fixing CohortMembership and ATOMIC_REQUESTS issue
What had been happening was related to the fact that ATOMIC_REQUESTS is now on, preventing writing to the database until a request is completed. The problem with that was that CohortMemberships, with their explicit transaction handling, were breaking that rule and touching the database. The CohortMembership needs to also touch the database to update the underlying course_user_groups information, to prevent the database from getting into a strange state. After this commit, every time a CohortMembership is updated or created, the corresponding course_user_groups are also updated and explicitly written to the database. This occurs atomically with the CohortMembership, and does not wait for the end of the request.
Showing
Please
register
or
sign in
to comment