http://www.macromedia.com/v1/handlers/index.cfm?ID=17318&Method=Full
Matt, read your link to Schley, who goes into it a bit, thanks Good: <cflock scope="application" timeout="2" type="readonly"> <cfset request.dsn=application.dsn> </cflock> <cfquery name="qUser" datasource="#request.dsn#"> SELECT FirstName, LastName FROM Users WHERE UserID = #form.UserID# </cfquery> Again, this solution again allows us to prevent the lock from persisting for the duration of the database query. Although application variables are widely used to store data source names, it probably makes more sense to avoid using an application variable in this case. This can be done by instead setting a request scope variable in the application.cfm file. Care should be taken when using CFSET to move complex data types like structures from one scope to another. This action does not really copy the structure from one scope to the other; it creates a pointer to the original object. This means that accesses to this new structure will be accesses to a shared scope variable if the original variable was shared scope, regardless of the new scope. The Duplicate( ) function can be used to copy the structure instead of creating a pointer to it. Using CFSET: <CFSET request.strDATA=application.strDATA> In this case, request.strDATA should still be treated as an application variable and locked appropriately. Using Duplicate( ): <CFSET request.strDATA=Duplicate(application.strDATA)> In this case, request.strDATA is not a pointer and can be treated like a request scope variable. To avoid deadlocks, do not nest CFLOCK tags, especially those of mixed scope." Colm -----Original Message----- From: Matt Horn [mailto:[EMAIL PROTECTED]] Sent: 17 October 2002 11:02 To: [EMAIL PROTECTED] Subject: RE: [ cf-dev ] Good/Bad? no you should drop the scope to request when you want to use the values http://www.macromedia.com/v1/handlers/index.cfm?ID=17318&Method=Full read that Matt At 10:57 17/10/02 +0100, you wrote: >so, if you edit the session variable in the session scope, it is edited in >the request scope.....ugly, damn ugly. > >-----Original Message----- >From: Matt Horn [mailto:[EMAIL PROTECTED]] >Sent: 17 October 2002 10:58 >To: [EMAIL PROTECTED] >Subject: RE: [ cf-dev ] Good/Bad? > > > >what this does is copy the value of the session variables down into a >request scope so you don't have to lock more than once > >it makes a "local copy" of the session vars > >AFAIK > > >At 10:54 17/10/02 +0100, you wrote: > >is it not simply making the session available to the application to talk to > >with request scope? > > > >Colm Brazel MA > >CB Publications > > > >www.cbweb.net <http://www.cbweb.net> > >[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > >[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > > > > > > > > > > > >-----Original Message----- > >From: Tom Smith [mailto:[EMAIL PROTECTED]] > >Sent: 17 October 2002 10:48 > >To: [EMAIL PROTECTED] > >Subject: Re: [ cf-dev ] Good/Bad? > > > > > >wont that just create a link to the session? surely duplicate() is much > >better? or have I gone mad... and readonly lockwill suffice. oh and the > >timeout is a little excessive, it shouldn't ever reach that level, and >users > >shouldn't have to wait 45 seconds even if it needs to be that long... if >it > >needs to be that long, I'd thing about rewriting the while site. > >----- Original Message ----- > >From: "Robertson-Ravo, Neil (REC)" <[EMAIL PROTECTED]> > >To: <[EMAIL PROTECTED]> > >Sent: Thursday, October 17, 2002 10:23 AM > >Subject: [ cf-dev ] Good/Bad? > > > > > > > I have just discovered this piece of code in a 3rd party CT.. its for > > > copying session vars into the request scope. > > > > > > <cfcase value="session2request"> > > > <cflock scope="SESSION" type="EXCLUSIVE" timeout="45"> > > > <cfloop collection="#session#" item="key"> > > > <cfset request[key] = session[key]> > > > </cfloop> > > > </cflock> > > > </cfcase> > > > > > > N > > > > > > -- > > > ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > For human help, e-mail: [EMAIL PROTECTED] > > > >__________________________________________________ Do You Yahoo!? >Everything > >you'll ever need on one web page from News and Sport to Email and Music > >Charts http://uk.my.yahoo.com > >-- > >** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > >For human help, e-mail: [EMAIL PROTECTED] > > > >--- > >Incoming mail is certified Virus Free. > >Checked by AVG anti-virus system (http://www.grisoft.com). > >Version: 6.0.394 / Virus Database: 224 - Release Date: 10/3/2002 > > > >--- > >Outgoing mail is certified Virus Free. > >Checked by AVG anti-virus system (http://www.grisoft.com). > >Version: 6.0.394 / Virus Database: 224 - Release Date: 10/3/2002 > > > > > >-- > >** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > >For human help, e-mail: [EMAIL PROTECTED] > > >-- >** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >For human help, e-mail: [EMAIL PROTECTED] > >-- >** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >For human help, e-mail: [EMAIL PROTECTED] -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.394 / Virus Database: 224 - Release Date: 10/3/2002 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.394 / Virus Database: 224 - Release Date: 10/3/2002 -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED]