Search code examples
liferayliferay-ide

How to put catche in liferay?


Earlier we are putting catche in liferay with help of below code.

 MultiVMKeyPoolUtil.put("SCHOOL", "ID", "Files");

In Liferay 6.2 MultiVMKeyPoolUtil not available so how can we put catche. There are no method like put in MultiVMPoolUtil class. I had search many alternative but couldn't find put method in it.


Solution

  • As MultiVMKeyPoolUtil not supported by liferay 6.2. I had used MultiVMPoolUtil class like below.

    MultiVMPoolUtil.getCache("SCHOOL").put("ID","Files");
    

    If you want to put collection as cache use below code.We require to make list serializable

    MultiVMPoolUtil.getCache("SCHOOL").put("ID",(Serializable) courses);