Thanks Jeff, you've help me get it clear in my head now. Given the size of my hangover right now that's quite an achievement ;)
Cheers, Pete (aka lad4bear)
----Original Message Follows----
From: Jeff Anderson <[EMAIL PROTECTED]>
Reply-To: [email protected]
To: [email protected]
Subject: Re: [CFCDev] CFC's and locking
Date: Sat, 28 May 2005 12:04:14 -0400
Peter,
<cflock> helps prevents race conditions and you SHOULD use it when writing
to the application scope (and even when reading depending on the
circumstances).
since you are instantiating the DAO only once (and setting the value to
variables.dsn only once) there cant really be a race condition within the
CFC. the value will always be the same.
if you are talking about another seperate DAO accessing the first DAO's
variables then that is a whole other bucket of worms.
-Jeff
On 5/28/05, Peter H <[EMAIL PROTECTED]> wrote:
>
> Hi Jeff, I should have been clearer in my explanation. In my
> application.cfm (I'm using 6.1) I use structkeyexists to ensure that my
> Dao is created only once and Initialise it with the dsn. As my Dao has its
> own variables.dsn it's no longer stateless.
>
> At the moment I'm not concerned about locking access to the Dao itself
> (although should I be?) Instead, I'm wondering whether I should lock access
> to variables.dsn when it called from other Dao method. i.e myDao.SelectX,
> myDao.DeleteX etc. As variables.dsn is effectively read-only I'm thinking
> no, but could very easily be wrong.
>
> I hope I was clearer and that I didn't misunderstand you're answer.
>
> Cheers, Pete (aka lad4bear)
>
>
>
>
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).
CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm
An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).
CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm
An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
