Breeze executeQuery随机失败

时间:2014-05-15 13:34:48

标签: javascript breeze

我们正在使用Breeze.js进行客户端数据管理。但是我在不同的调用中看到了breeze.executeQuery的随机错误。不确定是什么问题。

以下是我收到的错误(大部分时间都是这样,并且随机失败)

             at createHttpError (https://secure.landmark.com/cassette.axd/asset/Scripts/breeze.debug.js?c518691d8bcfc16a534f5519f0286f166524367f:14729:19)
                at handleHttpError (https://secure.landmark.com/cassette.axd/asset/Scripts/breeze.debug.js?c518691d8bcfc16a534f5519f0286f166524367f:14721:19)
                at Object.params.error (https://secure.landmark.com/cassette.axd/asset/Scripts/breeze.debug.js?c518691d8bcfc16a534f5519f0286f166524367f:14653:17)
                at Object.jqConfig.error (https://secure.landmark.com/cassette.axd/asset/Scripts/breeze.debug.js?c518691d8bcfc16a534f5519f0286f166524367f:14978:20)
                at fire (https://secure.landmark.com/cassette.axd/asset/Scripts/jquery-1.9.1.js?9a71104d8f0b4f5818518b3ece7c639bb308b13b:1040:30)
                at Object.self.fireWith [as rejectWith] (https://secure.landmarkdividend.com/cassette.axd/asset/Scripts/jquery-1.9.1.js?9a71104d8f0b4f5818518b3ece7c639bb308b13b:1151:7)
                at done (https://secure.landmark.com/cassette.axd/asset/Scripts/jquery-1.9.1.js?9a71104d8f0b4f5818518b3ece7c639bb308b13b:8079:14)
                at XMLHttpRequest.callback (https://secure.landmark.com/cassette.axd/asset/Scripts/jquery-1.9.1.js?9a71104d8f0b4f5818518b3ece7c639bb308b13b:8601:8)
            From previous event:
                at breeze.AbstractDataServiceAdapter.ctor.executeQuery (https://secure.landmark.com/cassette.axd/asset/Scripts/breeze.debug.js?c518691d8bcfc16a534f5519f0286f166524367f:14623:26)
                at executeQueryCore (https://secure.landmark.com/cassette.axd/asset/Scripts/breeze.debug.js?c518691d8bcfc16a534f5519f0286f166524367f:13798:48)
                at proto.executeQuery (https://secure.landmark.com/cassette.axd/asset/Scripts/breeze.debug.js?c518691d8bcfc16a534f5519f0286f166524367f:12556:23)
                at Object.lfPageViewHistoryLog (https://secure.landmark.com/cassette.axd/asset/SalesSystem/scripts/services/dataContext.js?691d65c697248098256cffc4eba5cbf725272e24:3914:28)
                at https://secure.landmarkdividend.com/cassette.axd/asset/SalesSystem/scripts/main/ViewModel.js?254753e87b1b17f15fb9396ea0865672aa75ad51:1030:33
            Exception type: System.Exception

以下是我发生上述错误的代码。

        var query = breeze.EntityQuery.from('lfSID').withParameters({ lfPrefix: '018' });

            return manager.executeQuery(query)
            .then(function (data) {
                var lfPageViewHistoryType = store.getEntityType("lfPageViewHistory");
                newPageViewHistory = lfPageViewHistoryType.createEntity();
                newPageViewHistory.PageViewHistorySID(data.results[0]);
                newPageViewHistory.SubjectSID(sid);
                newPageViewHistory.ViewedByID(loggedUser().Employee.EmployeeID());
                newPageViewHistory.ViewedOn(new Date());
                newPageViewHistory.UnauthorizedAccessAttempt(true);
                manager.addEntity(newPageViewHistory);
                manager.saveChanges([newPageViewHistory]).fail(dataContext.queryFailed);
            });

我知道这是非常少的投入,以获得你们的更多帮助,但这就是我所拥有的一切。

了解您的帮助

0 个答案:

没有答案