Can't update from a cached persistance object

2 posts, 0 answers
  1. Jon Baron
    Jon Baron avatar
    33 posts
    Member since:
    Jun 2010

    Posted 30 Mar 2012 Link to this post

    Hey all,

    I'm a long time user and advocate of the AJAX controls for .ASP.

    We're rewriting an application into MVC and need to use an interim ORM solution, we have things working fine on Entity Framework but wanted to explore Open Access to be thorough.

    We are caching all objects, to speed up access through out the system. dbContext.SaveChanges() doesn't seem able to save a persistence object if it's pulled from cache, even though the data of the object is changed after it's pulled from the Cache.

    The SaveChanges method commits nothing to the database, and the GetChanges method reports back nothing that is dirty.

    When retrieving a fresh object from the database prior to updating, the changes are committed as expected.

    Is this a known bug? Feature by design? Is there a performance boost in Open Access to make this a non-issue. To be fair I can't see a data query from the database being faster than a pull from memory; but it's worth asking the question :)

  2. Ady
    Ady avatar
    589 posts

    Posted 03 Apr 2012 Link to this post

    Hello Jon,

     Do you get any sort of exception when SaveChanges is called? SaveChanges should always persist any changes you have made irrespective of whether the object was cached or not.
    Is it possible to send me a sample application or some code that helps reproduce the behavior you experience?

    All the best,
    the Telerik team
    Telerik OpenAccess ORM Q1 2012 release is here! Check out what's new or download a free trial >>
Back to Top