The following doesn't seem to work: I'm trying to get my object to
persist, but (I think) I would prefer to access the object via the
request scope to reduce the number of locks needed. If I call a method
on request.def, it's missing instance variables (and throwing an
error, since they're required by the method), whereas with the
application.def, it works fine.

<!--- Store an instance of the helpDef object in the app scope --->
<cflock timeout="10" throwontimeout="No" type="exclusive"
scope="APPLICATION">
  <cfif not isdefined("application.def")>
    <!--- calling CFC with Dan Switzer's "component" -- a relative
pathing UDF, which works fine. --->
    <cfset application.def = request.component("Model/Help/helpDef")>
  </cfif>
  <!--- I'm unsure about the app scope locking needed in CFMX, so I'll
access the object from the app using the request scope --->
  <cfif not isdefined("request.def")>
    <cfset request.def = duplicate(application.def)>
  </cfif>
</cflock>

I'm fairly new to CFCs, so any tips, critiques, or debunkings of my
assumptions are welcome.

Thanks,
Jamie
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to