MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / set_isolation_level

Method set_isolation_level

lib/sqlalchemy/engine/interfaces.py:2430–2462  ·  view source on GitHub ↗

Given a DBAPI connection, set its isolation level. Note that this is a dialect-level method which is used as part of the implementation of the :class:`_engine.Connection` and :class:`_engine.Engine` isolation level facilities; these APIs should be preferred for

(
        self, dbapi_connection: DBAPIConnection, level: IsolationLevel
    )

Source from the content-addressed store, hash-verified

2428 raise NotImplementedError()
2429
2430 def set_isolation_level(
2431 self, dbapi_connection: DBAPIConnection, level: IsolationLevel
2432 ) -> None:
2433 """Given a DBAPI connection, set its isolation level.
2434
2435 Note that this is a dialect-level method which is used as part
2436 of the implementation of the :class:`_engine.Connection` and
2437 :class:`_engine.Engine`
2438 isolation level facilities; these APIs should be preferred for
2439 most typical use cases.
2440
2441 If the dialect also implements the
2442 :meth:`.Dialect.get_isolation_level_values` method, then the given
2443 level is guaranteed to be one of the string names within that sequence,
2444 and the method will not need to anticipate a lookup failure.
2445
2446 .. seealso::
2447
2448 :meth:`_engine.Connection.get_isolation_level`
2449 - view current level
2450
2451 :attr:`_engine.Connection.default_isolation_level`
2452 - view default level
2453
2454 :paramref:`.Connection.execution_options.isolation_level` -
2455 set per :class:`_engine.Connection` isolation level
2456
2457 :paramref:`_sa.create_engine.isolation_level` -
2458 set per :class:`_engine.Engine` isolation level
2459
2460 """
2461
2462 raise NotImplementedError()
2463
2464 def get_isolation_level(
2465 self, dbapi_connection: DBAPIConnection

Callers 3

test_reset_levelMethod · 0.45

Calls

no outgoing calls

Tested by 2

test_reset_levelMethod · 0.36