You have not var'd q_programs - use local.q_programs otherwise every concurrent request will be overwriting the same variable and you'll get unpredictable results.
Sean On Wed, Jan 13, 2010 at 11:35 PM, Jonathan Price <jonat...@imakehthissound.com> wrote: > > Yeah, we're on CF8 for better or worse. So I redid the previous function to > look like this: > > <CFFUNCTION name="getPrograms_a" access="public" returntype="Array"> > > <CFSET VAR local = {}> > > <CFINVOKE method="getPrograms_q" returnvariable="q_programs"> > > <CFSET local.a_programs = ArrayNew(1)> > <CFLOOP query="q_programs"> > <CFSET local.o_program = createObject('component', > '#REQUEST.cfcPathDot#.Program').init(programID = q_programs.ProgramID)> > <CFSET ArrayAppend(local.a_programs, local.o_program)> > </CFLOOP> > > <CFRETURN local.a_programs> > > </CFFUNCTION> > > > And I'm getting the correct info back now. Last two questions. 1) should I > not worry about running 'createObject' on the same local.o_program structure > member everytime? It's not completely obvious to me how 'local' magic is > working. And is there not a memory leak issue with running createObject on > every iteration? 2) Should my previous version have worked? I don't mind > doing this 'local' trick everywhere, but I am curious about why the o ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329700 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4