class documentation

class TransactionalContext(object):

Known subclasses: sqlalchemy.engine.base.Transaction, sqlalchemy.orm.session.SessionTransaction

View In Hierarchy

Apply Python context manager behavior to transaction objects.

Performs validation to ensure the subject of the transaction is not used if the transaction were ended prematurely.

Class Method ​_trans​_ctx​_check Undocumented
Method __enter__ Undocumented
Method __exit__ Undocumented
Method ​_get​_subject Undocumented
Method ​_rollback​_can​_be​_called indicates the object is in a state that is known to be acceptable for rollback() to be called.
Method ​_transaction​_is​_active Undocumented
Method ​_transaction​_is​_closed Undocumented
Instance Variable ​_outer​_trans​_ctx Undocumented
Instance Variable ​_trans​_subject Undocumented
@classmethod
def _trans_ctx_check(cls, subject):

Undocumented

def __enter__(self):

Undocumented

def __exit__(self, type_, value, traceback):

Undocumented

def _get_subject(self):
def _rollback_can_be_called(self):

indicates the object is in a state that is known to be acceptable for rollback() to be called.

This does not necessarily mean rollback() will succeed or not raise an error, just that there is currently no state detected that indicates rollback() would fail or emit warnings.

It also does not mean that there's a transaction in progress, as it is usually safe to call rollback() even if no transaction is present.

New in version 1.4.28.
def _transaction_is_active(self):
def _transaction_is_closed(self):
_outer_trans_ctx =

Undocumented

_trans_subject =

Undocumented