Yes, you would want to lock it with readonly ... but I would recommend
setting your session variables to local variables at the top of the page so
you only have to lock them once.

<cflock timeout="20" throwontimeout="No" type="READONLY" scope="SESSION">
 <cfset variables.username = "#session.username#">
</cflock>

THEN

<cfif variables.username Is "blah">
add some code
</cfif>

Paul Giesenhagen
QuillDesign
http://www.quilldesign.com
SiteDirector v2.0 - Commerce Builder



> Ok, this leads me to another question about locking, If I'm doing a check
> for a session variable, like say something like
> <cfif session.username is "blah">
>   add some code
> </cfif>
>
> should I have read only locks on pieces of code like that? we do have
> certain features that we look for a particular user via a session
variable.
> I'm wondering if I should lock all those too, or would that be overkill?
>
> Ben
>
>
>
>
> At 11:52 AM 4/23/2002, you wrote:
> >Hey Ben, try running your server in single-threaded mode ... not to
> >spark up the common session locking thread again, but Ben Forta states
> >that it _may_ be a wash (in terms of processing time) when you compare a
> >server running single-threaded vs. var & query locking, etc.... and as
> >Dave Watts recently posted... and I paraphrase... 'everything has a
> >price'. Anyhow, being the newbie that I am, I have been running a
> >similar sales tool w/ about 100 users and I have yet to turn off single
> >threading. But, the general consensus is LOCK EVERYTHING ALWAYS. Of
> >course, you say "all vars are locked"... Final thought, when I was
> >learning/testing cfid/cftoken I built some test fields into my login
> >page to echo the id/tokens and rounded up some testers and banged away.
> >It didn't break so I didn't fix it! :)
> >
> >Good luck,
> >
> >Mike
> >
> >Ben Densmore wrote:
> >
> > >There is no Proxy server, at the moment the IP addresses are static. I
> > >thought maybe the machines were using the same IP Address, but they are
not.
> > >
> > >Ben
> > >
> > >
> > >At 11:14 AM 4/23/2002, you wrote:
> > >
> > >>are they running behind a proxy sever?  it's entirely possible that
they
> > >>appear to be coming from the same IP address, confusing the server.
> > >>
> >
> >
> >
> 
______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to