postgres_psycopg2 adapter should not use hard coded isolation levels
|Reported by:||limscoder||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||1.4|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Django's postgres_psycopg2 adapter sets the connection's isolation level to psycopg2.extensions.ISOLATION_LEVEL_READ_COMMITTED when autocommit == False.
My application requires a more strict isolation level, so I am forced to create a new backend and override DatabaseWrapper._set_isolation_level to make sure the connection has the correct isolation level set.
There should be a configuration option within the database config in settings.py that allows users to set the appropriate isolation level if the default level is not correct for their application. It would also be nice if there was an option to not set the isolation level at all, and instead rely on the default isolation level provided by the Postgres server.
Change History (5)
comment:1 Changed 3 years ago by limscoder
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Summary changed from postgres_psycopg2 adapter uses hard coded isolation levels to postgres_psycopg2 adapter should not use hard coded isolation levels
comment:2 Changed 3 years ago by niwi
- Cc niwi@… added
- Has patch set