New Posts New Posts RSS Feed: Timeout on a really fast query
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Timeout on a really fast query

 Post Reply Post Reply
Author
pponzano View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Apr-2011
Location: Italy
Posts: 165
Post Options Post Options   Quote pponzano Quote  Post ReplyReply Direct Link To This Post Topic: Timeout on a really fast query
    Posted: 28-Dec-2011 at 2:51am
Hello IdeaBlade,
I'm currently facing troubles when executing a simple stored procedure that executing from SQLServer manager returns in 1-2 second...calling it from my WPF applicazion takes a lot of time and it goes in timeout (other stored procedure that takes 20-40 seconds run fine)

my call is :

    public void LoadData()
        {
            IsBusy = true;
            CanPrintExport = false;

            _repository.LoadNote(App.LoggedUser.IDIstituto, Date,
                           results =>
                           {
                               ResultList = new BindableCollection<NotesResult>(results.Cast<NotesResult>());

                               CanPrintExport = true;
                               IsBusy = false;
                           },
                                      e => MessageBox.Show(e.Message));

        }

and here's my call to the stored procesure in applicationrepository

   public INotifyCompleted LoadNote(int idIstituto, DateTime date, Action<IEnumerable> onSuccess, Action<Exception> onFail)
        {
            var query = Manager.myStore(idIstituto, date);

            query.CommandTimeout = 60; //this can be 180 ...always got the same problem
          
            var op = query.ExecuteAsync();

            return op.OnComplete(onSuccess, onFail);
        }

The strange thing is that a lot of time elapse between the load button click and the RPC completed on the Sql Server profile to appear..

Thanks
Paolo

Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 28-Dec-2011 at 8:49am
Does it always time out?  It may be that the timeout isn't coming from the database but is instead a communications timeout.  Looking at the exception and all inner exceptions may help indicate where the timeout is originating.  If it is a communications timeout, then my first thought would be to check the NotesResult class to be sure it's serializable and defined on both client and server. 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down