讓SaiKu實時展現查詢數據

在默認的情況下,saiku是不能對數據進行實時展現的,只能通過下圖的刷新按鈕或者重啓服務器來刷新數據

wKiom1Mw0kyCUm9BAABdDYXQBTs826.jpg

這樣以來會有很多的麻煩,每天得手動去刷新,這個操作只有管理員可以操作,在刷新以前客戶看到的都是緩存中的舊數據,有人說寫個shell去定時更新不行嗎?這個做法當然可以。除了這個做法,我來說說我的做法,讓saiku查詢完數據後即時加載,不用數據庫連接池,加載完成後立刻清除緩存中的數據,系統下次在加載的時候發現緩存是空的,就會自動去查詢新數據,這樣以來就可以做到實時展現,具體修改如下:

編輯 saiku/ui/js/saiku/Settings.js

LOCALSTORAGE_EXPIRATION: 10 * 60 * 60 * 1000 /* 10 hours, in ms */

修改後

LOCALSTORAGE_EXPIRATION: 1

編輯 saiku/plugin.spring.xml

<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.properties

修改前

# Boolean property that controls whether a RolapStar's aggregate data cache is cleared after each query.
mondrian.rolap.star.disableCaching=false

修改後

# Boolean property that controls whether a RolapStar's aggregate data cache is cleared after each query.
mondrian.rolap.star.disableCaching=true

好了,重新應用服務器,看看效果吧


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章