(this specific CFC) - this line produces the error:
<cfset OldSessions[KeyName] =
Duplicate(Application.CurrentUsers[KeyName])>
This line does not:
<cfset OldSessions[KeyName] = Application.CurrentUsers[KeyName]>
In addition this "fixes" the problem with the first one:
<cfset StructDelete(Application.CurrentUsers[KeyName], "Festival")>
<cfset OldSessions[KeyName] =
Duplicate(Application.CurrentUsers[KeyName])>
"Festival" contains the reference to my CFC. The rest of the structure
is pretty complex (but nothing that unusual) - adding in the reference
to the CFC blows it up.
In this case the CFC in question is pretty complex in and of itself. It
contains several collections of other CFCs which are deeply
self-referenced. CFDUMP, for example, cannot output this CFC due to the
self referencing - it hangs attempting to do so (this is a known issue
with CFDUMP and recursive self-references). I assume that the same
issue is causing the problem with Duplicate(),
If I do a null (unpopulated) version of the same CFC everything works -
adding evidence to my conclusion.
I'm coming very close to declaring a rule of thumb: "if it won't CFDUMP,
it won't Duplicate()".
That being said the CFC itself works just fine and has been fully
tested. The self-referencing isn't a problem in use, just with these
support functions and utilities.
Jim Davis
-----Original Message-----
From: Simon Horwith [mailto:[EMAIL PROTECTED]
Sent: Sunday, November 02, 2003 2:07 PM
To: CF-Talk
Subject: RE: Duplicate() and CFCs cause JRUN Servlet Error (500 Null)?
I hazard to guess it's something else in your code. I'm using CFCs
heavily
for all of my development and haven't seen this. I also just created a
structure containing a key that is an array whose first index is a
structure
with several keys, including one which is a duplicate() of a CFC
instance...
works fine for me.
~Simon
Simon Horwith
CTO, Etrilogy Ltd.
Member of Team Macromedia
Macromedia Certified Instructor
Certified Advanced ColdFusion MX Developer
Certified Flash MX Developer
CFDJList - List Administrator
http://www.how2cf.com/
-----Original Message-----
From: Jim Davis [mailto:[EMAIL PROTECTED]
Sent: 02 November 2003 18:04
To: CF-Talk
Subject: RE: Duplicate() and CFCs cause JRUN Servlet Error (500 Null)?
Just some more information:
On the production server I only get the cryptic "500 null" error. On
the dev box I get a CF formatted Java error
"java.lang.StackOverflowError".
Does duplicate() perhaps have problems with highly recursive CFCs?
The
CFC I've added which caused this problem is highly complex: a
container/collection object for several other types which all
cross-reference one another willy-nilly.
Could that be the root of the issue?
I would like to "duplicate" the struct (which is in the application
scope) so that I can delete it from the application scope and then do
some "busy work" on the data without locking the application scope.
but
I would like the CFC reference to be duped, not the whole CFC.
In MX if I don't duplicate the struct (just do a simple assignment)
then
delete the struct from application scope does the struct still hand
around because of the reference? For example:
<cfset OldSessions = StructNew()>
<cfloop collection="#Application.CurrentUsers#" item="KeyName">
<cfif DateCompare(Application.CurrentUsers[KeyName].SessionLastAccess
+
Request.App.SessionTimeout, Now()) LT 1>
<!--- Duplicate into the OldSessions Struct --->
<cfset OldSessions[KeyName] =
Duplicate(Application.CurrentUsers[KeyName])>
<!--- Delete the Session --->
<cfset StructDelete(Application.CurrentUsers, KeyName)>
</cfif>
</cfloop>
This is part of a session management system which allows for "end of
session" processing. The "OldSessions" struct would then be looped
over
and lots of work done with the data (storing session information for
metrics and analysis in a database, updating site stats, etc). When
this CFC reference is added to the "CurrentUsers" struct things blow
up.
If I just removed the "Duplicate()" would the data still be in the
"OldSessions" struct even tho I delete it from the Application? Would
it still maintain that data due to the pointer or would the pointer
then
become null?
Jim Davis
-----Original Message-----
From: Jim Davis [mailto:[EMAIL PROTECTED]
Sent: Sunday, November 02, 2003 12:46 PM
To: CF-Talk
Subject: Duplicate() and CFCs cause JRUN Servlet Error (500 Null)?
I've just finished a marathon session trying to track down a bug. The
error returned was simply "500 Null" alone on the page (not a CF
formatted error) with a page title of "JRun Servlet Error".
It turns out the problem occurred only when I attempted to use
Duplicate() on a complex struct containing a reference to a CFC.
I'm having some trouble reducing the problem so it may be specific to:
1) References CFCs in the Application scope being Duplicated to the
local scope.
2) References to CFCs in complex (nested) structs being duplicated.
3) Something else.
It's clear however that the call to Duplicate() is the root of the
problem. This was all working for a very long time with a very
complex
struct - the problem began immediately upon adding one CFC reference
into the struct.
Something with the CFC, Duplicate and maybe the Application scope?
Sound familiar to anybody?
Jim Davis
_____
_____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

