My choice is to ensure the CFC takes care of all locking within itself. If a group of operations need to be locked, make a new method that calls all the other methods within the lock. Named locks work well for this kind of thing.
One trick that can help with OO code is to create a unique lockname in the Init() method (based on a UUID) and save it as VARIABLES.myLockname (or similar). Then, all named locks for which you use that name are particular to that instance of the object. It doesn't matter where you instantiate it (SESSION, APPLICATION, whatever), the locks ensure that that object remains consistent and other instances of the same object can continue on their way without interference. If you really need to lock outside the object, you could create a getter method getLockName() (as long as that external lock applies only to that object and not data shared with other objects or other code). On 1/13/06, Baz <[EMAIL PROTECTED]> wrote: > Let's say you have a display TAG for Customer.CFC. And since we all know > that TAGs should never access outside variables, we pass in Customer.CFC. > All the TAG does is update some part of customer, and then displays its > values. > > Now let's say instead of passing in a new instance of Customer.CFC you pass > in session.CustomerObj. You've passed in a session scoped instance of > Customer, but the TAG doesn't know it, nor should it. So where do you lock? > > Baz > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:229412 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