在默認的狀況下,saiku是不能對數據進行實時展示的,只能經過下圖的刷新按鈕或者重啓服務器來刷新數據spring
這樣以來會有不少的麻煩,天天得手動去刷新,這個操做只有管理員能夠操做,在刷新之前客戶看到的都是緩存中的舊數據,有人說寫個shell去定時更新不行嗎?這個作法固然能夠。除了這個作法,我來講說個人作法,讓saiku查詢完數據後即時加載,不用數據庫鏈接池,加載完成後馬上清除緩存中的數據,系統下次在加載的時候發現緩存是空的,就會自動去查詢新數據,這樣以來就能夠作到實時展示,具體修改以下:shell
編輯 saiku/ui/js/saiku/Settings.js數據庫
LOCALSTORAGE_EXPIRATION: 10 * 60 * 60 * 1000 /* 10 hours, in ms */
修改後緩存
LOCALSTORAGE_EXPIRATION: 1
編輯 saiku/plugin.spring.xmlbash
<bean id="connectionManager" class="org.saiku.plugin.PentahoSecurityAwareConnectionManager" init-method="init" destroy-method="destroy"><property name="dataSourceManager" ref="pentahoDsManager" /><property name="userAware" value="false" /><property name="connectionPooling" value="true" /></bean>
修改後服務器
<bean id="connectionManager" class="org.saiku.plugin.PentahoSecurityAwareConnectionManager" init-method="init" destroy-method="destroy"><property name="dataSourceManager" ref="pentahoDsManager" /><property name="userAware" value="false" /><property name="connectionPooling" value="false" /></bean>
編輯mondrian/mondrian.propertieside
修改前ui
# Boolean property that controls whether a RolapStar's aggregate data cache is cleared after each query. mondrian.rolap.star.disableCaching=false
修改後spa
# Boolean property that controls whether a RolapStar's aggregate data cache is cleared after each query. mondrian.rolap.star.disableCaching=true
好了,從新應用服務器,看看效果吧orm