Chris

Re: Beer for thanks
Are you going to CFUNITED?

Here are my results with your fix in place. I'm still getting twice as many
readFields call as you are.

DEVELOPMENT MODE:
readFieldsCounterORIG= 0
session.totalTime[session.endTime - session.beginTime]=0
readFieldsCounterAFTERCREATERECORD=2
session.totalTime[session.endTime - session.beginTime]=172
readFieldsCountercreateDictionaryONE=4
session.totalTime[session.endTime - session.beginTime]=359
readFieldsCountercreateDictionaryTWO=6
session.totalTime[session.endTime - session.beginTime]=562
readFieldsCountercreateDictionaryTHREE=8
session.totalTime[session.endTime - session.beginTime]=765
readFieldsCountercreateDictionaryFOUR=10
session.totalTime[session.endTime - session.beginTime]=953
readFieldsCountercreateDictionaryFIVE=12
session.totalTime[session.endTime - session.beginTime]=1172

PRODUCTION MODE:
readFieldsCounterORIG= 0
session.totalTime[session.endTime - session.beginTime]=0
readFieldsCounterAFTERCREATERECORD=0
session.totalTime[session.endTime - session.beginTime]=16
readFieldsCountercreateDictionaryONE=1
session.totalTime[session.endTime - session.beginTime]=109
readFieldsCountercreateDictionaryTWO=2
session.totalTime[session.endTime - session.beginTime]=188
readFieldsCountercreateDictionaryTHREE=3
session.totalTime[session.endTime - session.beginTime]=281
readFieldsCountercreateDictionaryFOUR=4
session.totalTime[session.endTime - session.beginTime]=391
readFieldsCountercreateDictionaryFIVE=5
session.totalTime[session.endTime - session.beginTime]=453


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