Hi Aditya, I think the basic issue is that the DB Routers framework is not the right tool for the task you have in mind. You are trying to redirect all database activity according to request parameters. The routers are built for specific uses, and -- by design -- they don't cover all cases; it's not just transactions. Off the top of my head, it's also raw sql queries that you'd want to redirect in a similar way. So generally, Aymeric's suggestion of changing the settings -- although I agree with your criticism about its sensitivity to any form parallelism -- seems closer to the right track than the idea of extending the routers.
I _think_ -- haven't looked in the details, so this may be a complete blunder -- that you can achieve what you want using the Database Instrumentation framework; it is built to allow you to intervene in the execution of any SQL operation, at a lower level. HTH, Shai. -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/20210602125405.04071a33.shai%40platonix.com.