'Begin a nested transaction and return a transaction handle.
The returned object is an instance of :class:`.NestedTransaction`.
Nested transactions require SAVEPOINT support in the
underlying database.  Any transaction in the hierarchy may
``commit`` and ``rollback``, however the outermost transaction
still controls the overall ``commit`` or ``rollback`` of the
transaction of a whole.
See also :meth:`.Connection.begin`,
:meth:`.Connection.begin_twophase`.'

def begin_nested(self):

    if (self.__transaction is None):
        self.__transaction = RootTransaction(self)
    else:
        self.__transaction = NestedTransaction(self, self.__transaction)
    return self.__transaction
