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
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm