Re: session variable locking question

2001-03-23 Thread W Luke

Should client variables such as the following be inside a cflock?

CFIF DateDiff("n", Client.LastVisit, Now()) GTE 360
CFQUERY NAME="delClientVars" DATASOURCE="localads" MAXROWS=1
DELETE FROM CData
WHERE CFID = '#Cookie.CFID#:#Cookie.CFTOKEN#'
/CFQUERY
  cfset logged = False
/CFIF
cfif NOT IsDefined('Client.IsLoggedIn')
cfset logged = False

Cfelse
cfset logged = True
!-- User logged in as cfoutput#client.email#/cfoutput --pp
/cfif

Will
--
[EMAIL PROTECTED] -=- www.lukrative.com
Local-Advertising -=- www.localbounty.com

 it is better to wrap the whole hting inside the cflock

 cflock scope="Session" type="ReadOnly" timeout="5"
 cfif IsDefined("Session.user")
 CFSET REQUEST.USER = Session.user
 /cfif
 /cflock


 the reason?  Because what if it was read an existing session variable from
 another thread?  See?  wait, i dont know what I'm saying.  dont listen to
 me.  argh

 -Original Message-
 From: Tim Bahlke [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, March 22, 2001 2:15 PM
 To: CF-Talk
 Subject: session variable locking question


 In the following code, do I need a lock around the entire cfif statement?

 cfif IsDefined("Session.user")
 cflock scope="Session" type="ReadOnly" timeout="5"
 CFSET REQUEST.USER = Session.user
 /cflock
 /cfif

 Is it better to declare [lock]cfparam name="Session.user"
default=""[lock]
 instead of the IsDefined function?

 Thanks,

 Tim Bahlke

~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: session variable locking question

2001-03-23 Thread Bob Silverberg

No, you don't have to lock client variables as the database will take care
of that for you.  You only need to lock variables that reside in RAM
(session, application, server).  Although I'm not sure how scalable it would
be if Access is your database.  On a different issue, isn't the attached
code a bad idea?  I was given the impression that it's not a good idea to
monkey around manually with CFs client variable database.

Bob

-Original Message-
From: W Luke [mailto:[EMAIL PROTECTED]]
Sent: March 23, 2001 3:03 PM
To: CF-Talk
Subject: Re: session variable locking question


Should client variables such as the following be inside a cflock?

CFIF DateDiff("n", Client.LastVisit, Now()) GTE 360
CFQUERY NAME="delClientVars" DATASOURCE="localads" MAXROWS=1
DELETE FROM CData
WHERE CFID = '#Cookie.CFID#:#Cookie.CFTOKEN#'
/CFQUERY
  cfset logged = False
/CFIF
cfif NOT IsDefined('Client.IsLoggedIn')
cfset logged = False

Cfelse
cfset logged = True
!-- User logged in as cfoutput#client.email#/cfoutput --pp
/cfif

Will
--
[EMAIL PROTECTED] -=- www.lukrative.com
Local-Advertising -=- www.localbounty.com

 it is better to wrap the whole hting inside the cflock

 cflock scope="Session" type="ReadOnly" timeout="5"
 cfif IsDefined("Session.user")
 CFSET REQUEST.USER = Session.user
 /cfif
 /cflock


 the reason?  Because what if it was read an existing session variable from
 another thread?  See?  wait, i dont know what I'm saying.  dont listen to
 me.  argh

 -Original Message-
 From: Tim Bahlke [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, March 22, 2001 2:15 PM
 To: CF-Talk
 Subject: session variable locking question


 In the following code, do I need a lock around the entire cfif statement?

 cfif IsDefined("Session.user")
 cflock scope="Session" type="ReadOnly" timeout="5"
 CFSET REQUEST.USER = Session.user
 /cflock
 /cfif

 Is it better to declare [lock]cfparam name="Session.user"
default=""[lock]
 instead of the IsDefined function?

 Thanks,

 Tim Bahlke

~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: session variable locking question

2001-03-23 Thread Dave Watts

 Should client variables such as the following be inside a cflock?

No. Only memory variables (session, application, server) need to be locked.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: session variable locking question

2001-03-23 Thread Chris Martin

I was wondering, is there somewhere I can find a good discussion on why
locking session variables is a good idea?  I have heard that it is something
that should be done, but our project leader insists that we do not need to
do it.  What are the pros and cons of locking session variables?

Chris Martin


~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: session variable locking question

2001-03-23 Thread Jon Hall

Two that have helped me out.
http://www.allaire.com/handlers/index.cfm?ID=17196Method=Full

http://www.allaire.com/handlers/index.cfm?id=17318method=full

jon
- Original Message -
From: "Chris Martin" [EMAIL PROTECTED]
To: "CF-Talk" [EMAIL PROTECTED]
Sent: Friday, March 23, 2001 5:41 PM
Subject: RE: session variable locking question


 I was wondering, is there somewhere I can find a good discussion on why
 locking session variables is a good idea?  I have heard that it is
something
 that should be done, but our project leader insists that we do not need to
 do it.  What are the pros and cons of locking session variables?

 Chris Martin



~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: session variable locking question

2001-03-22 Thread Phoeun Pha

it is better to wrap the whole hting inside the cflock

cflock scope="Session" type="ReadOnly" timeout="5"
cfif IsDefined("Session.user")
CFSET REQUEST.USER = Session.user
/cfif
/cflock


the reason?  Because what if it was read an existing session variable from
another thread?  See?  wait, i dont know what I'm saying.  dont listen to
me.  argh

-Original Message-
From: Tim Bahlke [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 22, 2001 2:15 PM
To: CF-Talk
Subject: session variable locking question


In the following code, do I need a lock around the entire cfif statement?

cfif IsDefined("Session.user")
cflock scope="Session" type="ReadOnly" timeout="5"
CFSET REQUEST.USER = Session.user
/cflock
/cfif

Is it better to declare [lock]cfparam name="Session.user" default=""[lock]
instead of the IsDefined function?

Thanks,

Tim Bahlke
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists