I'm getting some very strange results from the Duplicate() method, and I
wonder if anyone on this list can tell me what's going on, and/or how I can
remedy the problem.
I have a CFC superclass that functions as a caching DAO for my application.
Its cached data is stored as a CF query object named THIS.Content. The
class exposes a method named getContentSubset(), which takes as arguments 1)
WHERE clause SQL code and 2) (optionally) names of new columns to add to the
subset. The method returns a new CF query object, containing all of the
columns of the THIS.Content property plus any new columns specified in the
arguments, and containing only the rows that are members of the set defined
by the passed SQL conditions.
The method starts off by invoking Duplicate() to make a copy of
THIS.Content, to which it adds any specified new columns. Here's the CFML
of the first part of the method.
<cffunction name="getContentSubSet" access="public"
returntype="query"
hint="returns the needed subset of data from the content"
>
<cfargument name="Criteria" type="String" required="TRUE"
default="">
<cfargument name="ExtraArg" type="Struct" required="False">
<cfset var tempArr = ArrayNew(1)>
<cfset var colList = THIS.Content.ColumnList>
<cfset var errDetail = "">
<cfset var tempQry = Duplicate(THIS.Content)>
<cfif not isDefined("tempQry")>
<cfsavecontent variable="errDetail">
<cfdump var="#THIS#" label="This is the EO
subclass instance that threw the exception.">
</cfsavecontent>
<cfthrow type="eWork.NoContent"
message="EntityObject.getContentSubset() was
called on an EO, which failed to Duplicate() its Content property."
detail="#errDetail#"
>
</cfif>
When the above code runs, it *sometimes* throws the eWork.NoContent
exception, yet the CFDUMP tag generates a perfectly ordinary-looking dump of
the query object THIS.Content. It seems as though Duplicate() is returning
a void reference, and I can't figure out why.
The app is developed and running under CFMX 6.1, *without* the latest
updater.
Can anyone help?
Steven Cason
Lockheed Martin Information Technology
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev'
in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]