It sounds like a named, exclusive lock around this would be a good idea, otherwise you will risk inconsistent data coming from multiple requests.
On 8/23/07, Rick Root <[EMAIL PROTECTED]> wrote: > Over the years, I've rarely used cflock for anything. I still don't > fully understand when I should use it. > > Anyway, I'm concerned about scaling CFMBB... lots of application scoped stuff. > > For example, there are many places where I do this: > > <cfset application.forum.updateForumData()> > > Application.forum is an instance of forum.cfc ... all the > updateForumData() does is run a bunch of queries to make sure the > denormalized columns in the forums table (msgcount and lastpost) and > in the threads table (lastpost) are up to date. This method is called > each time a message or topic is posted or deleted, and each time a > forum or conference is created or deleted. > > And everywhere I run it, I do this immediately after: > > <cfset application.qryForums = application.forum.getForums()> > <cfset application.qryThreads = application.thread.getThreads()> > > This seems like a place where I might need locking ... but I'm really > not sure =) > > In a very busy environment, this code could run a lot... imagine > thousands of active users on a baseball team web site during the world > series.. all posting new resposnes to the "official game thread"... > where you might get 2000 responses or more during a 3 hour game. > > And yet your list of threads might get viewed 100 times per second > during that time (which is why I'm putting the data - a relatively > small amount of data.. just list of forums and list of threads) into > the application scope. > > Comments? > > > -- > Rick Root > Check out CFMBB, BlogCFM, ImageCFC, ImapCFC, CFFM, and more at > www.opensourcecf.com > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Enterprise web applications, build robust, secure scalable apps today - Try it now ColdFusion Today ColdFusion 8 beta - Build next generation apps Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:286909 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

