No...  You are attempting to read application.dteToday without a lock...
Try this:

<cflock name="lcdc" type="READONLY" timeout="5">
   <cfif NOT IsDefined("application.dteToday")>
      <CFSET InitdteToday = 1 >
   </cfif>
</CFLOCK>

<CFIF IsDefined('InitdteToday')>
   <cflock name="lcdc" type="EXCLUSIVE" timeout="5">
      <cfset application.dteToday = #CreateODBCDate(Now())#>
   </cflock>
</CFIF>

You could also consider an application-wide solution such as copying your
aplication scope into the request scope in the application.cfm file.  Beware
though, that this metod may degrade performance on heavy traffic sites...

-Cameron

--------------------
Cameron Childress
elliptIQ Inc.
p.770.460.7277.232
f.770.460.0963

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Monday, March 12, 2001 12:17 PM
> To: CF-Server
> Subject: Proper Locking (on CF 4.01)
>
>
> Hopefully this is a simple question.
>
> Is this proper locking technique?
>
> <cfif NOT IsDefined("application.dteToday")>
>       <cflock name="lcdc" type="EXCLUSIVE" timeout="5">
>               <cfset application.dteToday = #CreateODBCDate(Now())#>
>       </cflock>
> </cfif>
>
> where "lcdc" is the name assigned in the cfapplication tag of
> application.cfm.
>
> Thanks.
>
> Chris
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
------------------------------------------------------------------------------
To unsubscribe, send a message to [EMAIL PROTECTED] with 
'unsubscribe' in the body or visit the list page at www.houseoffusion.com

Reply via email to