Author |
Message
|
nukalas2010 |
Posted: Tue Jul 03, 2012 8:59 pm Post subject: Reload Cache |
|
|
 Master
Joined: 04 Oct 2010 Posts: 220 Location: Somewhere in the World....
|
Hi All,
Currenlty in one of our main flow we get the cache by trigger a refresh of the shared row within an ATOMIC statement.... if we need the values to be constant for the duration of the flow, copy them from the shared area to a private (non shared) area using the ATOMIC statement and then reading from the private area.
if we had done any database changes means adding a new row, column etc. we are reloading execution group where the flow deployed. And the changes getting affected in the cache.
Is there any other way to get the updated records in the cache without restarting execution group...????
Thanks in Advance..  |
|
Back to top |
|
 |
nukalas2010 |
Posted: Wed Jul 04, 2012 3:28 am Post subject: |
|
|
 Master
Joined: 04 Oct 2010 Posts: 220 Location: Somewhere in the World....
|
Can anyone(vitor, lance, mgk, mqjeff, fjsiper, rekaarm....) throw some light on this ???  |
|
Back to top |
|
 |
McueMart |
Posted: Wed Jul 04, 2012 3:38 am Post subject: |
|
|
 Chevalier
Joined: 29 Nov 2011 Posts: 490 Location: UK...somewhere
|
Normally you will use some kind of Cache update event (potentially a message arriving on a particular input queue) which will identify that your cache is stale and will trigger for it to be updated with current data.
This could also be performed with a timer whereby every X seconds your cache is marked as stale - and the next attempt at accessing the cache causes it to be refreshed.
These seem quite basic ideas. Maybe i'm not fully understanding your problem. |
|
Back to top |
|
 |
kash3338 |
Posted: Wed Jul 04, 2012 4:02 am Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
You can have a UDP property to set the time (some x hrs) for which you need to reload the cache (which actually is to hit the DB again and load the data in your SHARED variable). Put your ATOMIC block of code inside a condition to check if you have exceeded the 'x' hours. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Jul 04, 2012 10:58 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
kash3338 wrote: |
You can have a UDP property to set the time (some x hrs) for which you need to reload the cache (which actually is to hit the DB again and load the data in your SHARED variable). Put your ATOMIC block of code inside a condition to check if you have exceeded the 'x' hours. |
McueMart wrote: |
Normally you will use some kind of Cache update event (potentially a message arriving on a particular input queue) which will identify that your cache is stale and will trigger for it to be updated with current data.
This could also be performed with a timer whereby every X seconds your cache is marked as stale - and the next attempt at accessing the cache causes it to be refreshed.
These seem quite basic ideas. Maybe i'm not fully understanding your problem. |
You could even just set a flag in the database that holds the cache, and each time through the flow, you check if it's true. If it's true, you reset it to false and reload the cache. Then you make sure all your processes to update the database also set the flag to true. |
|
Back to top |
|
 |
Esa |
Posted: Thu Jul 05, 2012 12:13 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
Consider updating the cache in a way that does not directly overwrite the cache or copy the contents of the cache to a temporary location before the update. So that you can copy them back if the update was not successful. Then the application can continue to run with the cached values even if the database connection is down. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Thu Jul 05, 2012 5:22 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
I would move your cache into a more robust interface, like solidDb. If your poor, then Singleton. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
|