2 Replies Latest reply on Oct 18, 2006 8:06 AM by droopcat

    CFC in session & locking

      I was just wondering about the following:

      When i create an instance of a CFC in a session scoped variable, the CF7 livedocs refence on using CFC's in persistent scopes says that we should lock "Code that calls methods of a persistent scope CFC instance that manipulate properties of the instance ".

      But i am thinking about using a get and set function within the CFC that handles the locking. Whenever a method within the CFC uses any of its properties it would go through one of these functions and so proper locking is ensured. So the code that is actually calling the method does not need to be locked, so i could just say for example: session.mycfc.dosomething(a,b,c) without putting <clock> tags around that.

      I think this will be perfectly fine, but would like to hear your comments and thoughts on this! Is this good practise?