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

Can't update from a cached persistance object

1 Answer 23 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jon Baron
Top achievements
Rank 1
Jon Baron asked on 30 Mar 2012, 07:27 PM
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 :)

Thanks!

1 Answer, 1 is accepted

Sort by
0
Ady
Telerik team
answered on 03 Apr 2012, 02:08 PM
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,
Ady
the Telerik team
Telerik OpenAccess ORM Q1 2012 release is here! Check out what's new or download a free trial >>
Tags
General Discussions
Asked by
Jon Baron
Top achievements
Rank 1
Answers by
Ady
Telerik team
Share this question
or