0
votes

I am using Breeze to load data in to my application. I do an initial load of the data when the app loads and that works fine. I also have a button that when clicked is supposed to get the data again. However when I click that button, the query fails, but the error message IS the json data.

Here's the code for the function:

var getULSLogs = function (filters) {

    var query = entityQuery
        .from('ULSLogs')
        .orderByDesc('LogTime')
        .take(app.rowLimit);

    return manager.executeQuery(query)
        .then(querySucceeded)
        .fail(function(e) {
            alert(e);
        });

    function querySucceeded(data) {
        console.log('Query Succeeded');
        data.results.forEach(function (item) {
            vm.ulslog.logs.push(item);
        });
    }
};

Since I don't get an actual error message, I'm not sure where to go from here. Any help is greatly appreciated.

1
I faced the same error when trying to refresh an entity with the relations {User} <-> {UserRoleMap} <-> {Role}. I traced the error down to proto.attachEntity of EntityGroup. The following code is present: if (this._entities[ix] === entity) { aspect.entityState = entityState; return entity; } throw new Error("This key is already attached: " + aspect.getKey()); If the entity is being refreshed from a server query, I'd think the equality comparison would fail and cause the error. - KMeda

1 Answers

0
votes

The return value in the 'fail' promise is a javascript object with a number of properties. Depending on the failure you may find more information by looking at this object in detail in a debugger.