The method IObjectScope.Refresh( object persistentObject ) refreshes the state of an object getting the latest values for it from the database. You can use it to update an object which data in the database may have been changed by another process.
As far as I understand you are having another process (or processes) that are changing regularly the data in your database. To get its current state you need to follow these steps:
1. Start a new transaction with scope.Transaction.Begin()
, so you get rid of the data that is stored in the cache;
2. Execute a query to get the latest data from the database (the cache is already evicted).
Keep in mind to call scope.Transaction.Commit()
if you want to send to the database any modifications your application might have made or scope.Transaction.Rollback()
I hope that helps.
the Telerik team