The short answer is "yes, you need to lock" - at least with a read only
lock.


The long answer is "your mileage will vary" as many people claim to have
never had locking problems from this.


One thing to keep in mind however is that the application scope is a
structure - so modifications to the structure itself may cause problems.
So, in other words, you may not be writing that specific value in the
struct, but you may write other values in the application scope that will
affect that value's position in memory.


It's the structure itself that's not thread-safe, not the variable in the
struct.


Or, at least that's what I've been told.


Jim Davis


  _____  

From: Bob Haroche [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 07, 2004 7:24 PM
To: CF-Talk
Subject: Newbie Locking Question


Using CF 5...

If I set an Application variable once in Application.cfm that is
(theoretically) never going to change, eg:

<cfset Application.DNS = MyDNS>

Do I really need to place "read only" locks around every query in the
application that wants to access that database? I could see the need
to do that if the Application.DNS were ever going to be re-written,
but assuming it's not going to be, is there harm in forgoing the lock?

-------------
Regards,
Bob Haroche
O n P o i n t  S o l u t i o n s
www.OnPointSolutions.com
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to