jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trekmbikes <s...@slickapps.com>
Subject Re: Hot / on-the-fly update of config
Date Wed, 21 May 2008 20:57:46 GMT

Niall, those are some great ideas. I will put those all down as proposals,
particularly the last one is appealing since I wouldn't have to move from
region to region. There may be some synchronization issues, e.g. if
something requests it from the cache after I've removed it but before I've
restored it.

Can one of the JCS authors comment on the live reconfiguration of the
isEternal attribute, or the MaxTimeSeconds attribute?

Thanks!


I know that you can configure cache attributes for each element (object)
you store in the cache programmatically.

There's an example of programmatic configuration here:
http://jakarta.apache.org/jcs/ElementAttributes.html

I don't know if attributes can be changed once configured however.
Personally, we aren't configuring elements programmatically, we just let
them inherit the region settings, and all servers are deployed with the
same region settings.

You basically want to set IsEternal=true for all your cached elements
when your DB goes offline.

Say in the worst case you can't reconfigure settings, as an alternative
you could...
Pre-configure (in the .ccf file) a new region called "DBOfflineRegion"
or something with IsEternal=true, but otherwise with settings similar to
those you use when your DB is online.
When your code detects that the DB is down, it iterates through all
cached items in your normal region, and copies them into the
DBOfflineRegion. It could remove them from the normal region as it
copies them, to save memory I guess.
Subsequently while the DB is down, your code is programmed to fetch data
from the DBOfflineRegion, as long as the DB remains down. When the DB
comes back online your code reverts back to using the normal region, and
clears the DBOfflineRegion.

Of course none of this would be necessary if you can just change
IsEternal or MaxLifeSeconds settings on-the-fly. You might be able to
effectively do that by retrieving everything from your normal region and
re-putting objects back into the same region with different attributes.
In general re-configuring everything in a distributed cache might
complicate things. Someone else could advise if it's supported.


-- 
View this message in context: http://www.nabble.com/Hot---on-the-fly-update-of-config-tp17364367p17375334.html
Sent from the JCS - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-users-help@jakarta.apache.org


Mime
View raw message