I need to refresh my PrimeFaces datagrid (version 3.3.1) every 30 seconds to fetch the modified value from database. Currently I’m using PrimeFaces poll, but it causing performance issue as every time makes a call to a database.
Is there any other way to refresh the content?
<p:poll interval="30" listener="#{BoardAction.Search}" update="boardpanel"/>
search is the function being called during the refresh.
If there is some other trigger that you can rely on to initiate the refresh you should use Push (by primefaces – since 3.4 version)
You you’ll use push the refresh will occur only when needed and not every 30 seconds, so you can save call to db
If you must do the refresh every 30 seconds , poll is the thing you need to use (You might consider fine tuning in you back-end code , maybe you db call could be improved)