A :class:`.Session`-level transaction. :class:`.SessionTransaction` is produced from the :meth:`_orm.Session.begin` and :meth:`_orm.Session.begin_nested` methods. It's largely an internal object that in modern use provides a context manager for session transactions. Docum
| 856 | |
| 857 | |
| 858 | class SessionTransaction(_StateChange, TransactionalContext): |
| 859 | """A :class:`.Session`-level transaction. |
| 860 | |
| 861 | :class:`.SessionTransaction` is produced from the |
| 862 | :meth:`_orm.Session.begin` |
| 863 | and :meth:`_orm.Session.begin_nested` methods. It's largely an internal |
| 864 | object that in modern use provides a context manager for session |
| 865 | transactions. |
| 866 | |
| 867 | Documentation on interacting with :class:`_orm.SessionTransaction` is |
| 868 | at: :ref:`unitofwork_transaction`. |
| 869 | |
| 870 | |
| 871 | .. versionchanged:: 1.4 The scoping and API methods to work with the |
| 872 | :class:`_orm.SessionTransaction` object directly have been simplified. |
| 873 | |
| 874 | .. seealso:: |
| 875 | |
| 876 | :ref:`unitofwork_transaction` |
| 877 | |
| 878 | :meth:`.Session.begin` |
| 879 | |
| 880 | :meth:`.Session.begin_nested` |
| 881 | |
| 882 | :meth:`.Session.rollback` |
| 883 | |
| 884 | :meth:`.Session.commit` |
| 885 | |
| 886 | :meth:`.Session.in_transaction` |
| 887 | |
| 888 | :meth:`.Session.in_nested_transaction` |
| 889 | |
| 890 | :meth:`.Session.get_transaction` |
| 891 | |
| 892 | :meth:`.Session.get_nested_transaction` |
| 893 | |
| 894 | |
| 895 | """ |
| 896 | |
| 897 | _rollback_exception: Optional[BaseException] = None |
| 898 | |
| 899 | _connections: Dict[ |
| 900 | Union[Engine, Connection], Tuple[Connection, Transaction, bool, bool] |
| 901 | ] |
| 902 | session: Session |
| 903 | _parent: Optional[SessionTransaction] |
| 904 | |
| 905 | _state: SessionTransactionState |
| 906 | |
| 907 | _new: weakref.WeakKeyDictionary[InstanceState[Any], object] |
| 908 | _deleted: weakref.WeakKeyDictionary[InstanceState[Any], object] |
| 909 | _dirty: weakref.WeakKeyDictionary[InstanceState[Any], object] |
| 910 | _key_switches: weakref.WeakKeyDictionary[ |
| 911 | InstanceState[Any], Tuple[Any, Any] |
| 912 | ] |
| 913 | |
| 914 | origin: SessionTransactionOrigin |
| 915 | """Origin of this :class:`_orm.SessionTransaction`. |
no outgoing calls
no test coverage detected