Thanks Peter!

I have another question for you then; our application make extensive
use of CFCs and most of those were preloaded and stored in application
scope variables.  However, when I move them over to Mach-II
properties, they caused that app to timeout after a server restart due
to the extreme amount of time it took to load all the CFCs into
memory.  This wasn't the case with the previous Application scope
solution, but obviously due to the additional Mach-II logic to load
these CFCs into the framework, it just takes longer.  We don't want to
deal with timeout issues in the production app, so what would you
recommend we do with these CFCs?  Would you suggest we just call them
normally within the application as they are being used or do something
with a timeout setting?

On Jun 23, 5:11 pm, "Peter J. Farrell" <[email protected]> wrote:
> Well, the problem is because your setting the brand via onApplicationStart. 
> When the framework reloads (because you probably are using the 
> Machii_config_mode 0 which is dynamic), it does not call onApplicationStart 
> again (which it shouldn't). I'd move your brand settings to configure time 
> parameters in the xml and have the configure method use getParameter to get 
> the data aand call setBrand.  This way everything is inisde M2 and your not 
> doing things with M2 outside of the M2 context (which is the case in App.cfc).
>
>
>
> -----Original Message-----
> From: MercuryNewt <[email protected]>
>
> Date: Tue, 23 Jun 2009 13:24:17
> To: Mach-II for CFML<[email protected]>
> Subject: [Mach-II] Re: Timing issue with setProperty defined properties
>
> Here's the brandManager code:
>
> <cfcomponent extends="MachII.framework.Property">
>
>         <cffunction name="configure" access="public" output="true"
> returntype="auth.model.BrandManager">
>                 <cfset variables.brands = structNew() />
>                 <cfreturn this/>
>         </cffunction>
>
>         <cffunction name="setBrand" access="public" output="false"
> returntype="boolean">
>                 <cfargument name="brandID" type="string" required="yes" />
>                 <cfargument name="brandStructure" type="struct" 
> required="yes" />
>                 <cfscript>
>                         var clientBrand = 
> createObject("component","model.Brand").init
> (arguments.brandID,arguments.brandStructure);
>                         
> structInsert(variables.brands,arguments.brandID,clientBrand);
>                 </cfscript>
>                 <cfreturn true />
>         </cffunction>
>
>         <cffunction name="getBrand" access="public" output="true"
> returntype="auth.model.brand" >
>                 <cfargument name="brandID" type="string" required="yes" />
>                 <cfreturn structFind(variables.brands,arguments.brandID) />
>         </cffunction>
>
> I add the brandManager via the Property tag and onApplicationStart I
> call the setBrand function in a loop to setup structure keys for
> specific brands, which is currently only one "FD".  Then later in our
> code we execute the getBrand function, passing in the clientID, "FD",
> and that's where we get the error.  Not everytime mind you, just after
> a certain period of time that the app has been running, as if the
> scope itself has timed out.
>
> On Jun 23, 3:23 pm, "Peter J. Farrell" <[email protected]> wrote:
> > I'd have to see your BrandManager code.  It's not a Mach-II issue --
> > sounds like an internal problem.  If it was a Mach-II issue, the
> > BrandManager would be gone in the properties.  Could you share your code?
>
> > MercuryNewt said the following on 06/23/2009 02:07 PM:
>
> > > Thanks for the reply, but I don't believe I'm dealing with that
> > > issue.  I have a component with a simple configure method that creates
> > > a structure "brands" within the variables scope and returns this.  The
> > > component has an addBrand method that adds a structure key to the
> > > "brands" structure such as "FD" and places a structure within that key
> > > so that the fully qualified variable for any brand value would be
> > > variables.brands.FD.whatever = true.  Now, once this is all loaded up
> > > onApplicationStart, I can reference any brand value via the getProperty
> > > ("brandManager").getBrand("FD").getResource("whatever") and this
> > > equals "true".  (Don't ask me why things are named the way they are,
> > > I'm just modifying the code ;o)  Anyway, the above works for literally
> > > hours of hitting the application and then all of a sudden an error
> > > will appear on a page that says the structure key "FD" is not
> > > available in a structure variables.brands in component
> > > brandManager.cfc.  This doesn't make any sense!
>
> > > On Jun 23, 10:43 am, jlcox <[email protected]> wrote:
>
> > >> Often when I find that things go missing on me, it's because I
> > >> neglected to var-scope a variable properly within a component
> > >> function.- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to Mach-II for CFML list.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/mach-ii-for-coldfusion?hl=en
SVN: http://greatbiztoolsllc.svn.cvsdude.com/mach-ii/
Wiki / Documentation / Tickets: 
http://greatbiztoolsllc.trac.cvsdude.com/mach-ii/
-~----------~----~----~----~------~----~------~--~---

Reply via email to