def METHOD_NAME(self, new_pointer, shard_key, db_session):
    """
    Persist transaction pointer to support restarts, update
    self.transaction_pointer.
    """
    pointer = db_session.query(ContactSearchIndexCursor).first()
    if pointer is None:
        pointer = ContactSearchIndexCursor()
        db_session.add(pointer)
    pointer.transaction_id = new_pointer
    self.transaction_pointers[shard_key] = new_pointer