The main object is stored in the session scope, call a session.<mainObject>.getWhere().isEqual() and that first time it runs it behaves as expected. Any subsequent calls to that iterator, if different from that first isEqual(), will return empty queries/arrays.
I am doing a reset() before calling the new getWhere().isEqual()
Just like Joshua was doing here:
<cfset contentIterator.reset() />
<cfset contentIterator.getWhere().isEqual("PageContent","cid",2) />
Am I using the Iterator incorrectly? Is this a problem with this revision?
Thanks in advance
I am using getWhere and passing in a query. Would that make a difference?Thanks,Josh
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of João FernandesSent: Wednesday, May 10, 2006 1:10 PM
To: [email protected]
Subject: RE: [Reactor For CF] Strange Interator ProblemBasically,
<object name="obj1">
<hasMany name="obj2">
<link name="obj3">
</hasMany>
</object>
<object name="obj2"/>
<object name="obj3">
<hasOne name="obj1">
<relate from="obj3_field" to="obj1_field"/>
</hasOne>
<hasOne name="obj2">
<relate from="obj3_field" to="obj2_field"/>
</hasOne>
</object>
<cfset record = reactorFactory.createRecord("obj1")>
<cfset record.load(id=somevalue)>
<cfdump var="#record.getobj2Iterator().getQuery()#" />
<cfset record.load(id=someothervalue)>
<cfdump var="#record.getobj2Iterator().getQuery()#" />
They are different here.
João Fernandes
Dep. Informática - Área de Desenvolvimento
Cofina media
Avenida João Crisóstomo, Nº 72 . 1069-043 Lisboa PORTUGAL
Tel (+351) 213 185 200 . Fax (+351) 213 540 370
[EMAIL PROTECTED]
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Joshua Scott
Sent: quarta-feira, 10 de Maio de 2006 18:37
To: [email protected]
Subject: RE: [Reactor For CF] Strange Interator Problem
Can you send me your code and let me see what I am doing wrong?
- JS
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of João Fernandes
Sent: Wednesday, May 10, 2006 11:51 AM
To: [email protected]
Subject: RE: [Reactor For CF] Strange Interator ProblemJoshua,
I can't reproduce your problem. I did something similar to your code and I get the correct results from the iterator.
João Fernandes
Dep. Informática - Área de Desenvolvimento
Cofina media
Avenida João Crisóstomo, Nº 72 . 1069-043 Lisboa PORTUGAL
Tel (+351) 213 185 200 . Fax (+351) 213 540 370
[EMAIL PROTECTED]
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Joshua Scott
Sent: quarta-feira, 10 de Maio de 2006 14:56
To: [email protected]
Subject: RE: [Reactor For CF] Strange Interator Problem
Any ideas?
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Joshua Scott
Sent: Tuesday, May 09, 2006 11:04 PM
To: [email protected]
Subject: RE: [Reactor For CF] Strange Interator ProblemI am using version 254 and am still having the problem.
I found that if I do a Load() on the record object it solves the problem, but I would think that reset should do it.
Any Ideas?
- JS
_____________________________________________________________________
joshua scott
resonant media technologies | complex problems - creative solutionsp. 214.550.1818
w. http://www.resonantmedia.com
_____________________________________________________________________
This message is confidential and is not intended to be used by anyone other than the designated recipient. Information herein is considered privileged, proprietary, and private information. Any other use (including possession or forwarding) of this message is prohibited and will be enforced with maximum penalty under domestic and international law. We are very serious about security and confidentiality.
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Doug Sims
Sent: Tuesday, May 09, 2006 10:29 PM
To: [email protected]
Subject: Re: [Reactor For CF] Strange Interator Problemyou may need to get the latest from SVN. see this post from a few days ago:
Gareth Cole
<[EMAIL PROTECTED]> to reactor
More options
May 2
I've got the following code:
currPage = application.reactor.createRecord("Page");
currPage.setPageID(1);
currPage.load();
q1 = currPage.getPageVersionIterator().getQuery();
currPage.setPageID(2);
currPage.load();
q2 = currPage.getPageVersionIterator().getQuery();
currPage.setPageID(3);
currPage.load();
q3 = currPage.getPageVersionIterator().getQuery();
Although the contents of the page record change when I set the PK and call load(), the iterator seems to be caching the query. q1 gives the same recordset as q2 and q3, when each of them should be different.
I've tried calling currPage.getPageVersionIterator().reset() in between the getQuery() calls, but it makes no difference.
Is this a bug, or is the iterator meant to work this way?
Thanks
-- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/
Reply
Forward
Invite Gareth to Gmail
Jared Rypka-Hauer
< [EMAIL PROTECTED]> to reactor
More options
May 2
Update Reactor to the latest release... that was just fixed
in the last day or two.
J- Show quoted text -
On Tue, 2 May 2006 22:47:58 +0100
"Gareth Cole" <[EMAIL PROTECTED]> wrote:
> I've got the following code:
>
>
>
> currPage = application.reactor.createRecord("Page");
>
>
>
> currPage.setPageID(1);
>
> currPage.load();
>
> q1 =
> currPage.getPageVersionIterator().getQuery();
>
>
>
> currPage.setPageID(2);
>
> currPage.load();
>
> q2 =
> currPage.getPageVersionIterator ().getQuery();
>
>
>
> currPage.setPageID(3);
>
> currPage.load();
>
> q3 =
> currPage.getPageVersionIterator().getQuery();
>
>
>
> Although the contents of the page record change when I
> set the PK and call
> load(), the iterator seems to be caching the query. q1
> gives the same
> recordset as q2 and q3, when each of them should be
> different.
>
>
>
> I've tried calling
> currPage.getPageVersionIterator().reset() in between the
> getQuery() calls, but it makes no difference.
>
>
>
> Is this a bug, or is the iterator meant to work this way?
>
>
>
> Thanks
>
>
>
>
>
> -- Reactor for ColdFusion Mailing List --
> [email protected]
> -- Archives at
> http://www.mail-archive.com/reactor%40doughughes.net/
-- Reactor for ColdFusion Mailing List -- [email protected]
-- Archives at http://www.mail-archive.com/reactor%40doughughes.net/
Reply
Forward
Invite Jared to Gmail
Gareth Cole
<[EMAIL PROTECTED] > to reactor
More options
May 2
Thanks Jared. It works perfectly now
On 5/9/06, Joshua Scott < [EMAIL PROTECTED]> wrote:
All,
I have having a strange iterator problem. I am creating a multi-lingual CMS
and created a test page for English and Spanish.
<!--- Pull Record Object from MG Viewstate --->
<cfset PageContent = viewstate.getValue("PageContent") />
<!--- Create Iterator --->
<cfset contentIterator = PageContent.getPageContentIterator() />
<cfoutput>
Spanish:<br>
<cfset contentIterator.reset() />
<cfset contentIterator.getWhere().isEqual("PageContent","cid",2) />
#contentIterator.getQuery().content#<br><br>
English:<br>
<cfset contentIterator.reset() />
<cfset contentIterator.getWhere().isEqual("PageContent","cid",1) />
#contentIterator.getQuery().content#<br><br>
The problem is I get content for the first one but not for the second. The
both have content.
Any ideas?
Thanks,
Josh
------------------------------------------------
Joshua Scott
Resonant Media Technologies, LLC.
http://www.resonantmedia.com | http://ponderings.wordpress.com
"It is impossible to get out of a problem by using the same type of thinking
that it took to get into the problem." -- Albert Einstein
-- Reactor for ColdFusion Mailing List -- [email protected]
-- Archives at http://www.mail-archive.com/reactor%40doughughes.net/
-- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/ -- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/-- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/
--
Aaron Lynch
www.AaronJLynch.com
www.WorldWildWeb.biz -- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/

