-sigh- Another Duplicate Bug

Duplicate must be the cursed function of CF. Recently I posted about a hotfix that was put out to correct issues with Duplicate. Rob Brooks-Bilson noted that there still seems to be issues:

Unfortunatley, it looks like this hot fix STILL doesn't fix all duplicate issues. I'm running into a problem while porting a (badly) written CF 4.5 application where a structure of arrays that is being manipulated by reference then passed to a COM method is causing an error. If I serialize then immediately deserialize the struct of arrays before passing it to the COM object, all is well. Using duplicate, however, results in a COM automation error in CFMX.

I haven't been able to test this yet, but it looks like the function may still need tweaking.

Archived Comments

Comment 1 by pedram posted on 4/6/2004 at 4:34 PM

hi ,
i need free coldFusion host
can help me ?
please email to me

tnx & bye

Comment 2 by Damon Gentry posted on 4/8/2004 at 9:26 PM

Yep, we're still seeing the problem after testing the (2nd) hotfix update. Message from my developers (I'm an admin).

This code fails:

<CFIF IsDefined("attributes.sortby") AND attributes.reorder AND qryList.RecordCount>

<CFLOCK scope="SESSION" type="EXCLUSIVE" throwontimeout="No" timeout="5">

<CFQUERY name="session.stListView.Query" dbtype="query">

select *

from session.stListView.Query

order by #attributes.sortby#

</CFQUERY>

<CFSET qryList = Duplicate(session.stListView["Query"])>

</CFLOCK>

</CFIF>

This code works (replace duplicate() with a query w/in a query to duplicate a recordset)

<CFIF IsDefined("attributes.sortby") AND attributes.reorder AND qryList.RecordCount>

<CFLOCK scope="SESSION" type="EXCLUSIVE" throwontimeout="No" timeout="5">

<CFQUERY name="session.stListView.Query" dbtype="query">

select *

from session.stListView.Query

order by #attributes.sortby#

</CFQUERY>

<CFQUERY name="qryList" dbtype="query">

select * from session.stListView.Query

</CFQUERY>

</CFLOCK>

</CFIF>