Very good point Ben, I was waiting for such a comment. But what if the TAG *does* update itself? Perhaps it allows you to choose an ID and gets some info from the DB based on it?
Plus there are no guarantees as to what's happening inside the CFC. Perhaps to return data it must update an internal variable first. You don't really know and you shouldn't have to, that's one of the beauties of CFCs. There must be a more secure, robust way of making TAGs scope agnostic. TAGs shouldn't have to know how the CFCs they are passed work or where they are stored. One bad solution would be to have a second trimmed down version of the CFC, that you use specifically to pass to TAGs. This CFC would contain only the methods that are safe no matter what scope the CFC is in. The problems with this are infinite though. Cheers, Baz -----Original Message----- From: Ben Nadel [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 18, 2006 11:51 AM To: CF-Talk Subject: RE: CFCs, TAGs, Locking If you are just displaying information, I would say that in like 99.9% of the time, even with race conditions, you wouldn't have to lock. Think about what the worst case scenario is here? Is it possible that you could display corrupt data, and if so, is it mission criticle? ........................ Ben Nadel Web Developer Nylon Technology 350 7th Ave. Suite 1005 New York, NY 10001 212.691.1134 x 14 212.691.3477 fax www.nylontechnology.com Sanders: Lightspeed too slow? Helmet: Yes we'll have to go right to ludacris speed. -----Original Message----- From: Baz [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 18, 2006 11:33 AM To: CF-Talk Subject: CFCs, TAGs, Locking Let's say you have a display TAG called DisplayOrder.cfm that accepts as an argument OrderObj.cfc. Basically the TAG displays the contents of the CFC. Let us also say that in 1 particular case you are passing an OrderObj that is stored in the application scope to the TAG. Where do you employ locking to avoid race conditions? It can't be within the TAG because sometimes locking is not necessary. So do you lock the entire call to the tag like so: <cflock> <Order:Display OrderObj="#application.OrderObj#"> </cflock> Does that even lock everything that happens within the tag and stop race conditions? Isn't it extremely inefficient to lock a potentially huge chunk of code when only a couple of lines really need to be locked? How do people generally handle this? Cheers, Baz ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:229899 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54