#33064: Created Model is not showing in Django Atomic Trasaction Block
-------------------------------------+-------------------------------------
Reporter: Dipen Sompura | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 3.1
(models, ORM) | Resolution:
Severity: Normal | worksforme
Keywords: transaction atomic | Triage Stage:
mysql | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Dipen Sompura):
Replying to [comment:1 Mariusz Felisiak]:
> Thanks for the report, however I cannot reproduce this issue on MySQL
(8.0.26, 5.6.50), SQLite, or PostgreSQL.
>
> Please reopen the ticket if you can debug your issue and provide details
about why and where Django is at fault.
Thank you for looking into this. I am able to debug the issue. We are
using reader and writer db instance with following DB router:
{{{#!python
class DBRouter:
def db_for_read(self, model, **hints):
"""Return read replica."""
return 'replica1'
def db_for_write(self, model, **hints):
# Always return the default database
return 'default'
def allow_relation(self, obj1, obj2, **hints):
return True
def allow_migrate(self, db, app_label, model_name=None, **hints):
return True
}}}
Any suggestion, where we can use same writer instance for the atomic block
by keeping my DBRouter configuration as is?
--
Ticket URL: <https://code.djangoproject.com/ticket/33064#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/070.87dc29e1d32ff693f023e3e4324a0997%40djangoproject.com.