I wrote an article and a tag to help with this type of situation.
Request.cfm
Article was "how to sidestep locking" in the April 2002 CFDJ.

Premise is rather than to replace all application tags with the <CFWDDX>
just rename them all to request.app both where you set them and where
you write them. Extended Search and Replace in CFStudio does just fine.

The tag <cf_request> will read and write session or client scoped
variables into and out of the request scope.  I've used it on some
larger sites with no problems.

http://www.shayna.com/index.cfm?fuseaction=coldfusion

I'm currently having my site moved to an MX server, so if there are
problems, email me and I will send you the items.


Just FYI, I implemented this solution on a site that had been in the
making for over 9 months and incorporated over 1200 templates.  It is
fuseboxed, but not the current implementation.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:Douglas.Knudsen@;alltel.com] 
Sent: Monday, November 11, 2002 12:43 PM
To: CF-Talk
Subject: RE: Locked Out


Tim, et al...

I'd strongly suggest you not use Duplicate to move session or
application scoped vars to the request scope.  Duplicate() works on
structures.  In CF5 and 4.5, I think this changed in CFMX, the
application and session scopes are not really true structures so
Duplicate doesn't quite do all you need.  IIRC correctly the big issue
was moving newly created vars back into the session or application
scope.  There was a big discussion on this over on CFDJ-List about six
months back.  What we pulled ou of it and use is

in application.cfm:
<!--- Move Session to Request FOR READS ONLY!!!--->
<cflock timeout="30" throwontimeout="No" type="READONLY"
scope="SESSION">
        <cfset structappend(request,Duplicate(session))>
</cflock>

in onrequestend.cfm
<cflock timeout="30" throwontimeout="No" type="EXCLUSIVE"
scope="SESSION">
        <cfset structAppend(session,Duplicate(request))>
</cflock>

This works very well and our boxen are very stable.  Note that any
script that mods or creates a request scoped var, thsi var gets dumped
int to session at the end of a request.  In otherwords, we never have to
lock anything but the above to statements.

In rogers case though, he will have to do a massive find/replace and
either add cflocks or do the above.

Doug

>-----Original Message-----
>From: Tim Painter [mailto:cftalk@;cfex.com]
>Sent: Monday, November 11, 2002 6:45 AM
>To: CF-Talk
>Subject: Re: Locked Out.
>
>Roger,
>     Just curious -- what is the purpose of 
>serializing/deserializing it
>into wddx and back to CF?  Couldn't you just use
><cfset request.application = Duplicate(application)> ?  (with 
>the proper
>locking of course)
>
>Tim P.
>
>> <cflock scope="application" type="READONLY" timeout="10">
>> <cfwddx action="CFML2WDDX" input="#application#"
>> output="temp">
>> <cfwddx action="WDDX2CFML" input="#temp#"
>> output="request.application">
>> <!--- You can replace the above two lines with the faster
>> <cfset request.application = Duplicate(application)>
>> if the contents of the application scope are simple.
>> Unfortunately, under CF5, Duplicate() tends to bomb
>> when used with structures-of-arrays-of structures and so
>> on. --->
>> </cflock>
>>
>> (4) Add the following to onrequestend.cfm:
>>
>> <cflock scope="application" type="EXCLUSIVE" timeout="10">
>> <cfwddx action="CFML2WDDX" input="#request,application#"
>> output="temp">
>> <cfwddx action="WDDX2CFML" input="#temp#"
>> output="application">
>> <!---
>> <cfset application = Duplicate(request.application)>
>> --->
>> </cflock>
>
>
>
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Reply via email to