Nice find Chris. However, I still think the root of the problem is that
Bryan does not have his Reactor instance in production mode. The fact that
in his tests he's getting the readFields twice indicates this, since in
production mode it only runs once. Bryan, can you post your ColdSpring.xml?



On 5/15/07, Chris Blackwell <[EMAIL PROTECTED]> wrote:

 Bryan,

Heres my results...

 DEVELOPMENT MODE
readFieldsCounterORIG= 0
readFieldsCounterTWO= 4
readFieldsCounterTHREE= 6
readFieldsCounterFOUR= 8

PRODUCTION MODE
readFieldsCounterORIG= 0
readFieldsCounterTWO= 1
readFieldsCounterTHREE= 2
readFieldsCounterFOUR= 3

I believe the reason why you will always see one call to readFields is
line 186 of objectFactory.cfc

186  <cfset var dictionaryXmlPath = 
"#getObject(arguments.alias).getMapping()#/Dictionary/#arguments.alias#dictionary.xml"
/>
getObject eventually fires off the readFields method

 reactor.config.config.getMapping() and reactor.core.object.getMapping()
both return the same value (or seem to in my test app "
/model/data/reactor")
This may have ramifications that i haven't forseen, but changing it to get
the mapping from the config object seems to work fine.

186   <cfset var dictionaryXmlPath =
"#getConfig().getMapping()#/Dictionary/#arguments.alias#dictionary.xml" />
 WITH ABOVE FIX - DEVELOPMENT
readFieldsCounterORIG= 0
readFieldsCounterTWO= 3
readFieldsCounterTHREE= 4
readFieldsCounterFOUR= 5

WITH ABOVE FIX - PRODUCTION
readFieldsCounterORIG= 0
readFieldsCounterTWO= 0
readFieldsCounterTHREE= 0
readFieldsCounterFOUR= 0

Can anyone confirm that this is ok? If it is, Bryan owes me a beer ;-)

Cheers, Chris

 ------------------------------
*From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
*On Behalf Of *Bryan S
*Sent:* 15 May 2007 16:22
*To:* [email protected]
*Subject:* Re: [Reactor for CF] Oracle Performance Improvement

Mommy!... Skip step 4 that's for Model Glue which we don't need any more.

On 5/15/07, Bryan S <[EMAIL PROTECTED] > wrote:
>
> Sorry! You also have to do this for the counting to work. I think I have
> it all this time.
>
> 1) open reactor/data/oracle/ObjectDao.cfc
> 2) find the readFields function
> 3) just ABOVE the query <cfquery name="qFields" put this code
>
> <cfif isDefined("session.readFieldsCounter")>
>    <cfset session.readFieldsCounter = session.readFieldsCounter + 1>
> <cfelse>
>    <cfset session.readFieldsCounter = 1>
> </cfif>
>
> 4) in dspTemplate.cfm put this code
>
> <cfif isDefined("session.readFieldsCounter")>
>    <h3>session.readFieldsCounter =
> <cfoutput>#session.readFieldsCounter#</cfoutput></h3>
> <cfelse>
>    <h3>session.readFieldsCounter = "Not Defined"</h3>
> </cfif>
>
> On 5/15/07, Bryan S < [EMAIL PROTECTED]> wrote:
> >
> > I missed one variable conversion in my prepared code. This should work
> > out of the box.
> >
> > <!---MODIFY THESE THREE LINES TO MATCH YOUR SYSTEM--->
> > <cfset yourTableName = "Widget">
> > <cfset yourColdspringXmlPath = "/mgsample01/config/ColdSpring.xml">
> > <cfset yourColdspringPath = "coldspring.beans.DefaultXmlBeanFactory">
> >
> > <!--- Create the coldspring bean factory --->
> > <cfset variables.instance.ColdSpringBeanFactory =
> > createObject("component","#yourColdspringPath#").init() />
> > <cffunction name="getColdSpring" access="public" returntype="any"
> > output="false">
> >     <cfreturn variables.instance.ColdSpringBeanFactory />
> > </cffunction>
> >
> > <!--- Read the xml file --->
> > <cfset
> > getColdSpring().loadBeansFromXmlFile("#yourColdspringXmlPath#",true) />
> >
> > <!--- get the Reactor bean based on the definition in the xml file
> > --->
> > <cfset variables.instance.Reactor = getColdSpring().getBean("Reactor")
> > />
> > <cffunction name="getReactor" access="public" returntype="any"
> > output="false">
> >     <cfreturn variables.instance.Reactor />
> > </cffunction>
> >
> > <cfset session.readFieldsCounter = 0>
> > readFieldsCounterORIG=<cfdump var="#session.readFieldsCounter#"
> > label=" session.readFieldsCounter"><br>
> >
> > <cfset YourObject = getReactor().createRecord("#yourTableName#")>
> >
> > <cfset dict = getReactor().createDictionary("#yourTableName#") />
> > readFieldsCounterTWO=<cfdump var="#session.readFieldsCounter#" label="
> > session.readFieldsCounter"><br>
> >
> > <cfset dict = getReactor().createDictionary("#yourTableName#") />
> > readFieldsCounterTHREE=<cfdump var="#session.readFieldsCounter#"
> > label="session.readFieldsCounter"><br>
> >
> > <cfset dict = getReactor().createDictionary("#yourTableName#") />
> > readFieldsCounterFOUR=<cfdump var="#session.readFieldsCounter#"
> > label="session.readFieldsCounter"><br>
> >
>
>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
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/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Reply via email to