1

We have an Java EE web application using iBatis for ORM. One of the dropdown (select box) shows a master data which is refreshed on a daily basis (say 4.00 AM) via cron jobs loading flat file into oracle database table.

Since the dropdown/select-box has to list ~1000 records and it was static data for 24 hrs, we used the CacheModel feature in iBatis. The select query was made to use a CacheModel with settings "ReadOnly=true & Serialized=true flushInterval=24 hours", so that a single cache will be shared across all users.

There will no insert/update/delete operations happening from the application to modify this master data

Question:

If the external job loading data to this oracle table fails and if the iBatis cache is flushed for the day before we manually load the data in the table, how can i get the iBatis cache flushed again inbetween of the day when i rerun a failed cron job ?

Please note that, there will not be any Insert/Update/Delete operations from the application

4

1 回答 1

1

您可以以编程方式刷新缓存。

有2种方法

void flushDataCache() 
Flushes all data caches.

void flushDataCache(java.lang.String cacheId) 
Flushes the data cache that matches the cache model ID provided.

SqlMapClient界面中。

http://ibatis.apache.org/docs/java/user/com/ibatis/sqlmap/client/SqlMapClient.html

于 2012-11-19T18:49:33.043 回答