* ``SERIALIZABLE``
* ``SNAPSHOT`` - specific to SQL Server
-.. versionadded:: 1.2 added AUTOCOMMIT isolation level setting
+There are also more options for isolation level configurations, such as
+"sub-engine" objects linked to a main :class:`.Engine` which each apply
+different isolation level settings. See the discussion at
+:ref:`dbapi_autocommit` for background.
.. seealso::
the database connection will return true for the value of
``SELECT @@autocommit;``.
+There are also more options for isolation level configurations, such as
+"sub-engine" objects linked to a main :class:`.Engine` which each apply
+different isolation level settings. See the discussion at
+:ref:`dbapi_autocommit` for background.
+
.. seealso::
:ref:`dbapi_autocommit`
---------------------------
Most SQLAlchemy dialects support setting of transaction isolation level
-using the :paramref:`_sa.create_engine.execution_options` parameter
+using the :paramref:`_sa.create_engine.isolation_level` parameter
at the :func:`_sa.create_engine` level, and at the :class:`_engine.Connection`
level via the :paramref:`.Connection.execution_options.isolation_level`
parameter.
engine = create_engine(
"postgresql+pg8000://scott:tiger@localhost/test",
- execution_options={
- "isolation_level": "REPEATABLE READ"
- }
+ isolation_level = "REPEATABLE READ"
)
To set using per-connection execution options::
with conn.begin():
# ... work with transaction
+There are also more options for isolation level configurations, such as
+"sub-engine" objects linked to a main :class:`.Engine` which each apply
+different isolation level settings. See the discussion at
+:ref:`dbapi_autocommit` for background.
+
Valid values for ``isolation_level`` on most PostgreSQL dialects include:
* ``READ COMMITTED``
.. seealso::
- :ref:`postgresql_readonly_deferrable`
-
:ref:`dbapi_autocommit`
+ :ref:`postgresql_readonly_deferrable`
+
:ref:`psycopg2_isolation_level`
:ref:`pg8000_isolation_level`