This is a migrated thread and some comments may be shown as answers.

SalesHub sample - old values showing up when editing

4 Answers 54 Views
Sample Applications
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dylan Nicholson
Top achievements
Rank 1
Dylan Nicholson asked on 16 Sep 2015, 10:43 AM

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...

 

4 Answers, 1 is accepted

Sort by
0
Dylan Nicholson
Top achievements
Rank 1
answered on 16 Sep 2015, 10:54 AM
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?
0
Dylan Nicholson
Top achievements
Rank 1
answered on 16 Sep 2015, 11:05 AM

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...

 

0
Tina Stancheva
Telerik team
answered on 21 Sep 2015, 12:15 PM
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
0
Dylan Nicholson
Top achievements
Rank 1
answered on 21 Sep 2015, 11:40 PM
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.
Tags
Sample Applications
Asked by
Dylan Nicholson
Top achievements
Rank 1
Answers by
Dylan Nicholson
Top achievements
Rank 1
Tina Stancheva
Telerik team
Share this question
or