'Creates a savepoint inside the current transaction. Returns an
identifier for the savepoint that will be used for the subsequent
rollback or commit. Does nothing if savepoints are not supported.'

def savepoint(self):

    if (not self._savepoint_allowed()):
        return
    thread_ident = thread.get_ident()
    tid = str(thread_ident).replace('-', '')
    self.savepoint_state += 1
    sid = ('s%s_x%d' % (tid, self.savepoint_state))
    self.validate_thread_sharing()
    self._savepoint(sid)
    return sid
