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" <pe...@mach-ii.com> 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 <jl...@goodyear.com> 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 -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to Mach-II for CFML list.
To post to this group, send email to mach-ii-for-coldfusion@googlegroups.com
To unsubscribe from this group, send email to 
mach-ii-for-coldfusion-unsubscr...@googlegroups.com
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