Brain farting here too...
What if my application variable contains a factory
that retrieves objects and then I call setters on
those objects w/o a lock?
config = application.beanFactory.getBean("baseConfig")
config.setValue("name","value")
Is this bad?
Thanks All,
Tom
On 5/3/07, Dave Watts <[EMAIL PROTECTED]> wrote:
> 1. I cflock a block of code that stores ws.cfc in
> application scope (singleton). The lock is exclusive.
>
> 2. For each page request, I read-only cflock a small block
> of code to cfset ws = application.ws -- locking this small
> block of code is good for performance instead of having to
> lock everywhere I need to use this component. (is ws a
> complete copy of application.ws, or is it just a reference to it?)
>
> 3. I can then reference "ws" for the remainder of my page
> call without locking, instead of using application.ws and
> having to cflock everywhere.
>
> Is this correct, or have I totally forgotten my locking rules
> for CF 6.1?
Objects are passed by reference, not by value. So, you're not creating a
copy of application.ws, just a pointer to it.
That said, if you're not calling any setter methods within application.ws,
you can just dispense with the locking entirely.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!
This email has been processed by SmoothZap - www.smoothwall.net
You are subscribed to cfcdev. To unsubscribe, please follow the
instructions at http://www.cfczone.org/listserv.cfm
CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]
You are subscribed to cfcdev. To unsubscribe, please follow the instructions at
http://www.cfczone.org/listserv.cfm
CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]