def commit ( self , session = None ) : if self . __cleared : return if self . _parent : # nested transaction self . _commit_parent ( ) else : self . _commit_repository ( ) self . _clear ( )
excuting sql query from sqlalchemy in python
Merge modified objects into parent transaction .
def commit(self, session=None):
        """Merge modified objects into parent transaction.

        Once commited a transaction object is not usable anymore

        :param:session: current sqlalchemy Session
        """
        if self.__cleared:
            return

        if self._parent:
            # nested transaction
            self._commit_parent()
        else:
            self._commit_repository()
        self._clear()