Author |
Message
|
joemq |
Posted: Tue May 19, 2015 3:04 pm Post subject: How to reload the saved cache every 24 hours |
|
|
Novice
Joined: 18 May 2012 Posts: 10
|
Hi,
I am using a SHARED ROW to store the database records and to use it further with out interacting with the database from next time onwards. Basically i am storing the records in to a cache.
My questions is if some one did any changes to the dababase how to get those changes and I have a requirement that every 24 hours reload the cache and get the latest database records
How can we achieve this in esql? |
|
Back to top |
|
 |
Armageddon123 |
Posted: Tue May 19, 2015 6:08 pm Post subject: |
|
|
Acolyte
Joined: 11 Feb 2014 Posts: 61
|
one option is to use TimeoutNotification node |
|
Back to top |
|
 |
kash3338 |
Posted: Tue May 19, 2015 6:30 pm Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
If your requirement is constant to reload every 24 Hrs, have a logic in your ESQL to check on previous reload time and when it reaches more than 24 Hrs fetch from DB again and load your cache. |
|
Back to top |
|
 |
joemq |
Posted: Tue May 19, 2015 9:57 pm Post subject: |
|
|
Novice
Joined: 18 May 2012 Posts: 10
|
Reload wont happen every 24 hours . I Just have to check database in every 24 hours and reload my cache data with what ever present in database. we are using some logic in shared variables so that it wont hit database again for evey run. Please let me know. |
|
Back to top |
|
 |
zpat |
Posted: Tue May 19, 2015 10:53 pm Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
As he said, just record in the cache the date/time the data was loaded into the cache.
Before you access the cache data, check that date/time, if it's a different date or more than 24 hrs old (whichever you prefer), refresh the cache data from the database. _________________ Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error. |
|
Back to top |
|
 |
ladman |
Posted: Wed May 20, 2015 3:42 am Post subject: |
|
|
Newbie
Joined: 07 Mar 2012 Posts: 3
|
I would consider using the TimeoutNotification Node - especially if you're thinking performance and/or have more than one instance of the flow.
Using this node you can (almost) ensure that the cache is always updated when a message arrive, and you will also ensure that you only fetch the data once if you have additional listeners. |
|
Back to top |
|
 |
Vitor |
Posted: Wed May 20, 2015 4:54 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
If you're using IIBv9, use the inbuilt shared cache & "time to live" _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
joemq |
Posted: Wed May 20, 2015 5:31 am Post subject: |
|
|
Novice
Joined: 18 May 2012 Posts: 10
|
|
Back to top |
|
 |
mqjeff |
Posted: Wed May 20, 2015 5:38 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
joemq wrote: |
I am not using IIBv9. |
Have you reviewed the availability of the global cache in the version you are using? |
|
Back to top |
|
 |
|