Order of transaction commits with ATOMIC_REQUESTS on multiple databases

Hi,

I want to enable transactions by setting ATOMIC_REQUESTS to true. we use multiple databases and I want to control the order of the commits. lets say that the request should always be committed in db2 first before db1. I know we can do this by having with transaction.atomic() wrappers but it is not clear how I could achieve the same when enabling transactions through ATOMIC_REQUESTS

From looking at the source it seems that views are going to be wrapped in whatever order is defined in your DATABASES settings (dict preserve insertion order in all versions of Python that the currently supported versions of Django support).

It doesn’t appear to be configurable in any other fashion.

1 Like