Pages

Wednesday, 25 April 2012

Caching a particular Entity disabling - custom portlet

Entity caching disabling - custom portlet

In some cases we need to disable caching for some Entities in Liferay according to requirements. In one of my project i got a requirement where i got this use case for my plugin portlet


By default Liferay caches all the entities.

First Option : One way to do it is, at entity level in service.xml set cache-enabled attribute to false as below

    <entity name="MyModelEntity" table="MyModelEntity" local-service="true" remote-service="true" cache-enabled="false">

Second option:  You can disable the same @ portlet level by setting following properties, in your portal.properties under src folder of your portlet plugin add following porperties (I am not pretty much sure about below one)

value.object.entity.cache.enabled.com.xyz.abc.common.model.MyModelEntity=false;
value.object.finder.cache.enabled.com.xyz.abc.common.model.MyModelEntity=false;

Colored in blue is path to your model entity

I hope it will helpful for some who is looking for similar stuff.

Thanks to http://btnkumar.blogspot.in

No comments:

Post a Comment