Show
Ignore:
Timestamp:
4/28/2008 9:09:50 PM (3 weeks ago)
Author:
dhughes
Message:
 
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/reactor/core/objectFactory.cfc

    r397 r430  
    184184                <cfset var generate = false /> 
    185185                <cfset var DictionaryObject = 0 /> 
    186                 <cfset var dictionaryXmlPath = "#getObject(arguments.alias).getMapping()#/Dictionary/#arguments.alias#dictionary.xml" /> 
     186                <cfset var tempmapping = "/" & Replace(getMapping(), ".", "/", "all") /> 
     187                <cfset var dictionaryXmlPath = "#tempmapping#/Dictionary/#arguments.alias#dictionary.xml" /> 
    187188                <cfset var ObjectTranslator = 0 /> 
    188189                 
     
    197198                                                <cfset variables.Cache["Dictionary"][arguments.alias] = DictionaryObject /> 
    198199                                        </cfif> 
    199  
     200                                         
    200201                                        <cfcatch> 
    201202                                                <!--- we only need the dbobject if it doesn't already exist ---> 
     
    233234                <cfset var Object = 0 /> 
    234235                 
    235                 <cfset Object = CreateObject("Component", "reactor.core.object").init(arguments.name, getConfig()) /> 
    236                  
    237                 <!--- read the object ---> 
    238                 <cfset variables.ObjectDao.read(Object) /> 
     236                <!--- 
     237                        this is a bit of a hack.  See, within one request we might need to hit the DB several times to get the same config settings for one object. 
     238                        we only want to hit the db once per that request.  So, I'm using *shock* a request variable right here in a CFC.  Deal with it! 
     239                ---> 
     240                <cfparam name="request.reactor.Object" default="#StructNew()#" /> 
     241                 
     242                <cfif NOT StructKeyExists(request.reactor.Object, arguments.name)> 
     243                        <cfset Object = CreateObject("Component", "reactor.core.object").init(arguments.name, getConfig()) /> 
     244                 
     245                        <!--- read the object ---> 
     246                        <cfset variables.ObjectDao.read(Object) /> 
     247                         
     248                        <cfset request.reactor.Object[arguments.name] = Object /> 
     249                <cfelse> 
     250                        <cfset Object = request.reactor.Object[arguments.name] /> 
     251                </cfif> 
    239252                 
    240253                <!--- return the object --->