def get_session(store):
    """
    Return the current session or raise an error.

    """
    data_set = store.model_class.resolve()
    session = data_set.session
    if session is None:
        raise AttributeError("No session is available in SQLiteContext")

    return session