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

Cache is Killing Me

2 Answers 91 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.
Nelson
Top achievements
Rank 1
Nelson asked on 14 Sep 2011, 04:57 PM
Hi there, sorry for the title, but the terrible truth is that my project viability is put to risk and I don't know what to do.

I'm developing a silverlight application that uses Telerik ORM connected to an Oracle DB.

I use a Datacontext in my silverlight application and when I access from two debbugable executables I can see that the changes made into any entity are not reflected (refreshed) in the other instance of the application.

I change a client name, for example, and that changed name is not update in the other application instance.. I do not want to cache my entities.

How can I disable those cache attributes?

I've tried several modifications, but I couldn't get the expected result. Please check the attached images and if you can please give me some indications.

Thanks in advance,
Nelson

2 Answers, 1 is accepted

Sort by
0
Accepted
Ralph Waldenmaier
Telerik team
answered on 15 Sep 2011, 11:08 AM
Hello Nelson,

Thank you for the provided screenshots. Without having detailed information about your project, I can imagine, that the behavior belongs to the OpenAccessContext. It looks like that you either don't call the SaveChanges() Method of the Context, which will result in saving all changes to the context and setting the state of the object to hollow(Details about object states can be found here) or you don't create a new OpenAccessContext whenever you are requesting the data. In general it is recommended to have a stateless OpenAccessContext meaning that you are using a using block for the OpenAccessContext whenever you are accessing data. What you can do is the following:
1. Ensure that the changes are indeed pushed to the database. You can do so by simply doing a query in the database itself and checking if the edited values made it there.
2. Request the object in your second application from the server again using its ID. This should act as a refresh and it should fix your problem.

Additionally I would like to point you to our SDK where you can find sample projects for using Telerik OpenAccess ORM in Silverlight environments.

I hope this information is helpful for you.

Kind regards,
Ralph
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's SQL Server Community Awards. We are competing in TWO categories and every vote counts! VOTE for Telerik NOW >>

0
Nelson
Top achievements
Rank 1
answered on 21 Sep 2011, 02:11 PM
I've resolved it :)

I wasn't using the LoadBehavior.RefreshCurrent when I was loading my objects from database!

Thanks
Tags
General Discussions
Asked by
Nelson
Top achievements
Rank 1
Answers by
Ralph Waldenmaier
Telerik team
Nelson
Top achievements
Rank 1
Share this question
or