MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / after_rollback

Method after_rollback

lib/sqlalchemy/orm/events.py:1882–1898  ·  view source on GitHub ↗

Execute after a real DBAPI rollback has occurred. Note that this event only fires when the *actual* rollback against the database occurs - it does *not* fire each time the :meth:`.Session.rollback` method is called, if the underlying DBAPI transaction has already bee

(self, session: Session)

Source from the content-addressed store, hash-verified

1880 """
1881
1882 def after_rollback(self, session: Session) -> None:
1883 """Execute after a real DBAPI rollback has occurred.
1884
1885 Note that this event only fires when the *actual* rollback against
1886 the database occurs - it does *not* fire each time the
1887 :meth:`.Session.rollback` method is called, if the underlying
1888 DBAPI transaction has already been rolled back. In many
1889 cases, the :class:`.Session` will not be in
1890 an "active" state during this event, as the current
1891 transaction is not valid. To acquire a :class:`.Session`
1892 which is active after the outermost rollback has proceeded,
1893 use the :meth:`.SessionEvents.after_soft_rollback` event, checking the
1894 :attr:`.Session.is_active` flag.
1895
1896 :param session: The target :class:`.Session`.
1897
1898 """
1899
1900 def after_soft_rollback(
1901 self, session: Session, previous_transaction: SessionTransaction

Callers 1

rollbackMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected