Clear L2 cache + server farm

6 posts, 0 answers
  1. RICHARD FRIEND
    RICHARD FRIEND avatar
    16 posts
    Member since:
    Nov 2008

    Posted 10 Jul 2009 Link to this post

    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
  2. Dimitar Kapitanov
    Admin
    Dimitar Kapitanov avatar
    632 posts

    Posted 10 Jul 2009 Link to this post

    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.
  3. DevCraft banner
  4. Vlad Rus
    Vlad Rus avatar
    1 posts
    Member since:
    Jul 2009

    Posted 20 Jul 2009 Link to this post

    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
  5. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 20 Jul 2009 Link to this post

    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.
  6. Patrice Boissonneault
    Patrice Boissonneault avatar
    18 posts
    Member since:
    Mar 2010

    Posted 30 Mar 2011 Link to this post

    Has the API been built now?

    Thanks.
  7. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 31 Mar 2011 Link to this post

    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
Back to Top
DevCraft banner