• How to use global cache


    As we talk before, AX has no support with sigleton instance modle, but we can use the global cache insteaded. 

    1、Create the global cache.

    1 SysGlobalCache globalCache;
    2 ;
    3 
    4 globalCache = ClassFactory.globalCache();  //全局缓存,客户端和服务端都可以用,但依赖调用方
    5 globalCache = Appl.globalCache();       //全局缓存,客户端和服务端都可以用,但依赖调用方
    6 globalCache = infolog.globalCache();     //全局缓存,客户端和服务端都可以用,建议使用这种缓存  
    7 globalCache.set("Owner",  [key], "Value");

    2、Get the global cache value.

    1 SysGlobalCache globalCache;
    2 ;
    3 
    4 globalCache = infolog.globalCache();
    5 print globalCache.get("Owner", [Key]);   //获取缓存值,根据缓存所有者、键值获取值
    6 globalcache.remove("Owner", [Key]);       //清除缓存
  • 相关阅读:
    11.json
    10.正则表达式
    9.面向对象、类
    bzoj 2878: [Noi2012]迷失游乐园
    bzoj 2727: [HNOI2012]双十字
    bzoj 3224: Tyvj 1728 普通平衡树
    bzoj 3932: [CQOI2015]任务查询系统
    bzoj 1997: [Hnoi2010]Planar
    4 Django简介
    3 web框架
  • 原文地址:https://www.cnblogs.com/Jinnchu/p/2663230.html
Copyright © 2020-2023  润新知