this sounds like a job for client variables. Set up a blank table in your DB, create a datasource for it in the CF Admin. While in the CF Admin, activate client variables and point it at the datasource... DO NOT let it use the registry to store client vars under any circumstance.
The things that need to be replicated could then be stored in the client scope. On Fri, Jul 18, 2014 at 9:37 AM, Cameron Childress <camer...@gmail.com> wrote: > > On Thu, Jul 17, 2014 at 5:10 PM, Uday Patel wrote: > > > I have an application running on single server and i was caching some > > commonly used data in Application scope. There is a logic tied in my > > caching object such that when data changes the cache is rebuild. > > > > Now we are moving to clustered server environment with 3 three servers. > If > > the cached data changes I need to replicate them across other servers. I > > want the other servers to go to database and get new data. How can I > > achieve this. > > > You definitely should look at using an external cache (Russ' suggestion). > > For application scope - I've also solved this in the past with a Database > table something like this: > > instance (varchar): Name of CF instance or machine name > refreshdate (datetime): moment in time that this instance last updated it's > app scope > > 1) In onApplicationStart(), put a quick check to see if the instance or > machine name is present in the table, if not, add it. > 2) In onRequestStart(), put a select statement that checks to see if the > refreshdate is null for the instance or machine. If so, rebuild the > application scope here. > > When you want to refresh the app scope on all servers, just set > "refreshdate = null" on all entries in that table. It does add one DB call > to every request, but if you only have three servers that table should only > have three entries. The DB call should be very very fast. > > See also: > > http://www.carehart.org/blog/client/index.cfm/2012/6/30/get_instancename_in_cf10 > http://www.petefreitag.com/item/97.cfm > > -Cameron > > -- > Cameron Childress > -- > p: 678.637.5072 > im: cameroncf > facebook <http://www.facebook.com/cameroncf> | twitter > <http://twitter.com/cameronc> | google+ > <https://profiles.google.com/u/0/117829379451708140985> > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358911 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm