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

another problem with the new version

3 Answers 74 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Hans
Top achievements
Rank 1
Hans asked on 17 Mar 2011, 08:04 PM
Hi again !

In a form I load and object, I do some modification ad I save it . Everything is ok. IF I load again the same object, the properties shows the old values not the new ones even in the database are the new values. So I trace the querry and the select return the new values but for some reason the object inside is not updated. If i close the program and reloaded again, yes , it brings the correct values.
So is something wrong with the cache.
The database is sql server and the code is :

 

public class DA_WoJobDetail

{

 

private static WoDbContext _localContext = new WoDbContext();

 

 

 

public static WO_JobDetail GetWoJob(string JobNo)

 

{

WO_JobDetail obj = (from c in _localContext.WO_JobDetails where c.JobNo == JobNo select  c).FirstOrDefault();

 

return  obj;

 

 }
}

Before , in the last version it worked just fine.

So can you tell me what is wrong ?

And a question. When I return an object is lazy loading, so only when I use it it will query the database. Can you tell me how I can loaded imediatelly ,in the moment I execute the linq ?

Thank you !
Hans

 

3 Answers, 1 is accepted

Sort by
0
Damyan Bogoev
Telerik team
answered on 21 Mar 2011, 04:14 PM
Hello Hans,

Firstly I want to apologize for the inconvenience caused. We have located the cause for the problem and fixed it. The fix will be included in the next internal build of the product which is expected later this week.
If you cannot wait for the build, you could use a long-running context in the helper class in order to avoid this behavior.
We will let you know once the new build is available.

Kind regards,
Damyan Bogoev
the Telerik team
0
Hans
Top achievements
Rank 1
answered on 21 Mar 2011, 04:20 PM
Thanks for you answer.

Can you please answer  the last question
"When I return an object is lazy loading, so only when I use it it will query the database. Can you tell me how I can loaded imediatelly ,in the moment I execute the linq ? "

Hans

0
Damyan Bogoev
Telerik team
answered on 22 Mar 2011, 10:35 AM
Hi Hans,

I recommend you reading the following help articles which explain how to control data retrieving:
Deferred versus Immediate Loading;
How to: Retrieve Many Objects At Once;
How to: Control How Much Related Data Is Retrieved;
Hope you will find the provided information useful.

Kind regards,
Damyan Bogoev
the Telerik team
Tags
Getting Started
Asked by
Hans
Top achievements
Rank 1
Answers by
Damyan Bogoev
Telerik team
Hans
Top achievements
Rank 1
Share this question
or