Ray,

I agree that you've probably done this before. It's all over in the Spectra
code when variables are copied to the Server scope (not a structure as far
as I know).

We have had problems with the duplicate() function as well. With all the
newest updates (SP 2 and the cfserver.exe replacement), the function works
fine for copying structures and arrays. It even works fine for small
queries, but when you try to duplicate() large queries, you will often get
very low-level errors.

We've got some code that pretty consistently creates the error with
duplicate() and queries. Ray, if you email David Aden directly, he can send
it to you.

As a solution to the problem, you can use WDDX to copy the query reliably:

<!--- serialize, deserialize and output --->
<cfwddx action="cfml2wddx" input="#request.q_all_files#" output="temp">
<cfwddx action="wddx2cfml" input="#temp#" output="caller.#request.r_query#">

This is similar to the code the cfa_deepcopy used with Spectra 1.0 on CF 4.5
or earlier. Because we copy large queries frequently, one of the first
things we do when installing Spectra is replace the code in cfa_deepcopy
that uses duplicate() with the WDDX alternative. It's a little slower, but
it won't generate errors.

HTH,

Jason

----
Jason Aden
Allaire Certified Developer
[EMAIL PROTECTED]
www.wwstudios.com

> -----Original Message-----
> From: Raymond Camden [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, March 13, 2001 11:28 AM
> To: Spectra-Talk
> Subject: RE: Duplicate() Bug, Questions
>
>
> Well, it _could_ hold a complex variable. I mean, I've used the
> code he has
> below to return structures before.
>
> (Or at least I think I have.)
>
> Let me try this myself, now I'm curious. :)
>
> =======================================================================
> Raymond Camden, Principal Spectra Compliance Engineer for Allaire
>
> Email   : [EMAIL PROTECTED]
> ICQ UIN : 3679482
>
> "My ally is the Force, and a powerful ally it is." - Yoda
>
> > -----Original Message-----
> > From: Emily B. Kim [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, March 13, 2001 11:25 AM
> > To: Spectra-Talk
> > Subject: Re: Duplicate() Bug, Questions
> >
> >
> >
> > >     <cfset "caller.#request.r_query#" =
> duplicate(request.q_all_files)>
> > >.. . . to "return" the final query to the calling template.
> >
> >
> > oooooohhhhhhhhh...i think i understand. i think the problem has
> > to do with
> > the fact that what i think you're really doing in that statement
> > is to try
> > and copy the query set into a LOCAL variable - a non-complex
> > variable type
> > that can't hold queries. "caller." is really a local variable that's
> > exposed to the calling page. hmmmm....have you tried:
> >
> > <CFSET
> "caller.request.#request.r_query#"=duplicate(request.q_all_files)>
> > [EMAIL PROTECTED] with 'unsubscribe' in the body.
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
------------------------------------------------------------------------------
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/spectra_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to