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

How to Expire Cached Data

1 Answer 87 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.
Garrett
Top achievements
Rank 1
Garrett asked on 01 May 2011, 04:27 PM
Hello,

I can't seem to find any good examples on how to expire cached data in OpenAccess. Is there a good tutorial or example that shows how cache can be expired based on how old the data is?

Thanks,

Garrett

1 Answer, 1 is accepted

Sort by
0
Damyan Bogoev
Telerik team
answered on 02 May 2011, 03:48 PM
Hi Garrett,

Actually you could use the OpenAccessContext methods SaveChanges() and ClearChanges() to achieve that goal. They will start a transaction which will evict the data stored in the cache.
You could evict a specific persistent capable object from the cache using the IObjectScope.Evict(persistentCapableObject) method. The OpenAccessContext instance has an underlying IObjectScope object. In order to expose it you should do the following steps:
1. Create a partial class for the generated context class;
2. Create a property that returns an IObjectScope and call this.GetScope() method;
I am sorry for the inconvenience caused.

Regards,
Damyan Bogoev
the Telerik team
Q1’11 SP1 of Telerik OpenAccess is available for download; also available is the Q2'11 Roadmap for Telerik OpenAccess ORM.
Tags
General Discussions
Asked by
Garrett
Top achievements
Rank 1
Answers by
Damyan Bogoev
Telerik team
Share this question
or