Exemple #1
0
        protected internal override void _EndExecute()
        {
            if (_asyncResult == null)
            {
                return;                 // means either not started or already executed
            }
            else if (_asyncResult.IsCompleted == false)
            {
                return;                 //Cannot proceed with EndExecute, report is still executing
            }
            try
            {
                string data = _asyncDelegate.EndInvoke(_asyncResult);
                _cellset.LoadCellset(data);
            }
            catch (Exception exc)
            {
                _asyncResult  = null;
                _olapTaskGuid = Guid.Empty;
                _state        = Report.StateEnum.Open;

                throw exc;
            }

            _asyncResult  = null;
            _olapTaskGuid = Guid.Empty;
            _state        = Report.StateEnum.Executed;
        }
Exemple #2
0
            public bool End()
            {
                if (inner != null)
                {
                    return(executeDelegate.EndInvoke(inner));
                }

                return(false);
            }
            // Called when asynchronous method call finished.
            private void ExecuteCompletedCallback(IAsyncResult ar)
            {
                // Retrieve the delegate.
                ExecuteDelegate caller = (ExecuteDelegate)((AsyncResult)ar).AsyncDelegate;

                try
                {
                    // Finish the invocation. (Here we could receive out values if out parameters had been defined in the delegate)
                    caller.EndInvoke(ar);
                }
                catch (Exception exception)
                {
                    // Any unhandled exception of the asynchronous method call can be handled here.
                    // Note: Handle all exceptions here. Otherwise the SData Server would shut down.
                    lock (_parentPerformer._asyncStateObj)
                    {
                        _parentPerformer._asyncStateObj.Tracking.Phase       = TrackingPhase.ERROR;
                        _parentPerformer._asyncStateObj.Tracking.PhaseDetail = exception.Message + " ***** Stack Trace ***** " + exception.StackTrace;
                    }
                }
            }