SalesHub sample - old values showing up when editing

5 posts, 0 answers
  1. Dylan Nicholson
    Dylan Nicholson avatar
    11 posts
    Member since:
    Apr 2010

    Posted 16 Sep 2015 Link to this post

    This is actually very easy to reproduce, on both the live site and after building myself and running locally.

    Just edit any order, e.g. change the order number and save.

    Go back and edit it again, it might take two or three goes (clicking cancel and then edit again), and soon enough you'll see the original order number - i.e. it's not always showing the latest data from the DB. Trying to figure out the code it seems to be something weird about the lifetime management of the DbContext object. But it concerns me that a sample app like this would have such a fundamental bug...

     

  2. Dylan Nicholson
    Dylan Nicholson avatar
    11 posts
    Member since:
    Apr 2010

    Posted 16 Sep 2015 in reply to Dylan Nicholson Link to this post

    Confirmed it's definitely an issue with the SalesHubDbContext lifetime - if you create your own SalesHubDbContext in the constructors of the two relevant controllers it all works fine.  So why is Ninject re-using these objects?
  3. Dylan Nicholson
    Dylan Nicholson avatar
    11 posts
    Member since:
    Apr 2010

    Posted 16 Sep 2015 in reply to Dylan Nicholson Link to this post

    Figured that out too - it's currently using             kernel.Bind<ISalesHubDbContext>().To<SalesHubDbContext>().InThreadScope();

    Change it to InRequestScope() and it works a charm.  Thread-scope is obviously unsuitable for a DbContext derived class, not sure what the original developer was thinking...

     

  4. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 21 Sep 2015 Link to this post

    Hello Dylan,

    I am sorry to see you were having an issue with one of our samples. I will forward your feedback to the development team for comments. But I want to take this opportunity and ask you to post any questions or comments targeting the Kendo UI Professional framework and samples, under the product's forums. Alternatively you can also submit a ticket targeting the Kendo UI Professional product through our ticketing system.

    Questions posted under the Telerik Platform forums should target the Telerik Platform tools and services and therefore any queries falling outside that area, may not reach the team they are targeting in time. Further, they reach the Telerik Platform community which may not be as experienced with the Kendo UI Web components as the Kendo UI community.

    Regards,
    Tina Stancheva
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  5. Dylan Nicholson
    Dylan Nicholson avatar
    11 posts
    Member since:
    Apr 2010

    Posted 21 Sep 2015 in reply to Tina Stancheva Link to this post

    Ok...​but the problem is nothing to do with the Kendo UI Professional framework, as I understand it, in fact it was the way a third-party library (Ninject) was being used.
Back to Top