another problem with the new version

4 posts, 0 answers
  1. Hans
    Hans avatar
    49 posts
    Member since:
    Jul 2010

    Posted 17 Mar 2011 Link to this post

    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

     

  2. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 21 Mar 2011 Link to this post

    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
  3. DevCraft banner
  4. Hans
    Hans avatar
    49 posts
    Member since:
    Jul 2010

    Posted 21 Mar 2011 Link to this post

    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

  5. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 22 Mar 2011 Link to this post

    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
Back to Top