I was not able to find if we can set the polling interval for the timebased update in extreme scale.
It is a good requirement to set custom polling intrval depending on the transactional
nature of the database table
Can we set our custom interval ? How can be set this if we can ?
This topic has been locked.
3 replies Latest Post - 2013-03-01T19:04:00Z by SystemAdmin
Pinned topic Time based update for db update
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2013-03-01T19:04:00Z at 2013-03-01T19:04:00Z by SystemAdmin
lisaw 0600016B42101 PostsACCEPTED ANSWER
Re: Time based update for db update2013-02-27T23:21:03Z in response to SystemAdminIf you are using the write-behind plugin, you can specify update time and maximum key updates
<objectGrid name= "library" > <backingMap name= "book" writeBehind= "T300;C900" pluginCollectionRef= "bookPlugins"/>
T300;C900 The update time is 300 seconds and the update key count is 900.
Here's the topic in our Infocenter: IBM WebSphere eXtreme Scale Infocenter - Write-behind caching support
Websphere eXtreme Scale Development
Websphere eXtreme Scale Development
Re: Time based update for db update2013-02-28T02:12:19Z in response to lisawHi Lisa
I need the polling interval for reading from databse.My cache only needs to read from DB
When the record in DB changes we can use timebased updater to poll db for changes in a periodically and accordingly invalidate the corresponding in the cache.
in this i wanted to find out whether we can set the polling interval so that we can optimize it according to the rate of change of records in the table
Re: Time based update for db update2013-03-01T19:04:00Z in response to lisawHi
Let me add to this .Here was my test project :
I am able to preload data from a database table using client based loading.
Query the cache for the contents.
But I am stuck in the next step in getting the time based updates to poll the database fro any delta changes in the table. I read through the APIs available and found we will be able to start a time based updater in the code itself without doing it in grid xml .
I did that and I see hibernate queries getting fired periodically in the logs as described in the document.
But somehow when I query the cache , i do not see the updates that I committed in the database manually .The queries still give me the stale records.
Please let me know if i need to do something else after invoking the method as shown below to get my cache maps updated:
static CopyMode COPY_ON_READ_AND_COMMIT;
ObjectMap om = s.getMap("Ticket");
Ticket o = new Ticket();
TimeBasedDBUpdater.instance().startDBUpdate(_og, "Ticket","SAMPLE", Ticket.class, "_timeid", INSERT_UPDATE);
the logged hibernate querries are
Hibernate: select * from ( select max(ticket0_.TIMEID) as col_0_0_ from SAMPLEDATA ticket0_ ) where rownum <= ?
Hibernate: select * from ( select ticket0_.ERROR_INSTANCE as ERROR1_0_, ............ , ticket0_.TIMEID as TIMEID0_ from SAMPLEDATA ticket0_ where ticket0_.TIMEID>? ) where rownum <= ?
Hibernate: select * from ( select ticket0_.ERROR_INSTANCE as ERROR1_0_,............... , ticket0_.TIMEID as TIMEID0_ from SAMPLEDATA ticket0_ where ticket0_.TIMEID>? ) where rownum <= ?
(NOTE: I have just removed the other properties/columns and have put ...... in the place from the querry pasted above for easier readability purpose .)
Do I need to do some sort of persist/save /update after this method so that the fetched changes if any are persisted in the cache.