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
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.