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 underr 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.
Please feel free to drop your comments
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 underr 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.
Please feel free to drop your comments
thanks
ReplyDeletethanks!
ReplyDeleteI tried doing this but the cache still doesnt clear in my browser.
ReplyDeleteWhich option did you try first one/second one?
ReplyDeleteWhat was your Liferay version
Thank you for sharing this information. I find this information is easy to understand and very useful. Thumbs up!
ReplyDeleteSocial Media Services