def METHOD_NAME(self):
    for key in engine_manager.engines:
        with session_scope_by_shard_id(key) as db_session:
            pointer = db_session.query(ContactSearchIndexCursor).first()
            if pointer:
                self.transaction_pointers[key] = pointer.transaction_id
            else:
                # Never start from 0; if the service hasn't run before
                # start from the latest transaction, with the expectation
                # that a backfill will be run separately.
                max_id = db_session.query(func.max(Transaction.id)).scalar() or 0
                latest_transaction = db_session.query(Transaction).get(max_id)
                if latest_transaction:
                    self.transaction_pointers[key] = latest_transaction.id
                else:
                    self.transaction_pointers[key] = 0