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

Clear L2 cache + server farm

5 Answers 107 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.
RICHARD FRIEND
Top achievements
Rank 2
RICHARD FRIEND asked on 10 Jul 2009, 09:49 AM
Hi

We are using the L2 cache which works great, however we would like to add an admin function to blow the cache out, sometimes we may make data changes direct to the database (new lookup types etc..) and would the option to blow the cache out completely, is this possible ?

Also are there any docs regarding multiple servers and syncronising the cache between them?

Thanks
Richard

5 Answers, 1 is accepted

Sort by
0
Dimitar Kapitanov
Telerik team
answered on 10 Jul 2009, 10:26 AM
Hello RICHARD FRIEND,
Currently we do not provide publicly available API for evicting the cache, however we cooked a small sample that should help you out via reflection:
Database db = Database.Get("DatabaseConnection1"); 
            IObjectScope scope = db.GetObjectScope(); 
            Telerik.OpenAccess.RT.DatabaseAdapter dba = scope.Database.Adapter as Telerik.OpenAccess.RT.DatabaseAdapter; 
            OpenAccessRuntime.DataObjects.OpenAccessPersistenceManagerFactory pmf = 
                dba.GetType().GetMethod("GetImpl", BindingFlags.Instance | BindingFlags.NonPublic).Invoke(dba, nullas 
                OpenAccessRuntime.DataObjects.OpenAccessPersistenceManagerFactory; 
            pmf.evictAll(); 

Regarding your second question -  more about cache clustering and performance could be found here.

Kind regards,
Dimitar Kapitanov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Vlad Rus
Top achievements
Rank 1
answered on 20 Jul 2009, 04:40 PM
Hi Dimitar,

I am trying to invalidate the L2 cache on one object type only. evictAll() method has an overload accepting a Telerik.OpenAccess.Reflect.Class and a bool. The following does not work (getting a runtime error):

pmf.evictAll((Telerik.OpenAccess.Reflect.Class)typeof(MyORMManagedClass), true);

What do I need to do to call that method successfully for a specific class?

Thanks,
Vlad
0
Jan Blessenohl
Telerik team
answered on 20 Jul 2009, 04:53 PM
Hi Vlad Rus,
You do not have a chance, you have to wait for us to implement the API.

Sincerely yours,
Jan Blessenohl
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Patrice Boissonneault
Top achievements
Rank 2
answered on 31 Mar 2011, 02:39 AM
Has the API been built now?

Thanks.
0
Jan Blessenohl
Telerik team
answered on 31 Mar 2011, 08:45 AM
Hi Patrice Boissonneault,
Yes, the API is available
IObjectScope: scope.Database.Cache...

For context please add a partial class to your generated context and add a property:

public DatabaseLevelCache Cache
{
    get
    {
        return GetScope().Database.Cache
    }
}


Regards,
Jan Blessenohl
the Telerik team
Tags
General Discussions
Asked by
RICHARD FRIEND
Top achievements
Rank 2
Answers by
Dimitar Kapitanov
Telerik team
Vlad Rus
Top achievements
Rank 1
Jan Blessenohl
Telerik team
Patrice Boissonneault
Top achievements
Rank 2
Share this question
or