擅长:python、mysql、java
<p>来自SQLAlchemy的维护者Michael Bayer:</p>
<blockquote>
<p>Please use the "isolation_level"
argument to <a href="https://docs.sqlalchemy.org/en/13/dialects/postgresql.html?highlight=dialect#transaction-isolation-level" rel="nofollow noreferrer">create_engine()</a>
and use the <a href="http://hg.sqlalchemy.org/sqlalchemy/archive/default.tar.gz" rel="nofollow noreferrer">latest tip of SQLAlchemy</a>
until 0.6.4 is released, as there was
a psycopg2-specific bug fixed recently
regarding isolation level. </p>
<p>The approach you have below does not
affect the same connection which is
later used for querying - you'd
instead use a PoolListener that sets
up set_isolation_level on all
connections as they are created.</p>
</blockquote>