I just got an error from CF9 that the variable FileExists does not exist. Yeh,
like the built in CF function FileExists. Weird! And it is not the only one. I
am getting really strange errors when invoking methods of application scoped
cfc's. Here's the scenario, but I have no idea what is going on (although I've
been rewriting my entire application to try to fix it).
I have a custom CF9 App that runs entirely off Application.cfc. The bulk of the
work is in the OnRequest Function by instantiating application scoped request
handling CFC's and passing all request data and accessors for APP, CGI, and
Session vars. Any CFC's that have properties are instantiated via CreateObj()
to ensure I have a unique copy for the request. Other cfc's are passed info to
their methods and expected only to return results. The application name in
Application.cfc is dynamic based on the results of a query on cgi.server_name
to ensure each client has their own copy of the application (based on
account_ID, so: THIS.name = AppName_1, etc.)
Everything was working fine until I made several http calls in a single page
via cfdivs with url binds. I have a page with 5 cfdivs all bound to the same
URL as the actual page they are on (so control_panel.cfm has 5 cfdivs bound to
control_panel.cfm with different URL vars to return different parts of the
page.) When I run this page, especially if I flush the app and/or refresh it
several times I start getting strange errors like FileExists() is undefined.
75% of the time the page runs with no errors, but occassionally it will throw a
really strange CF error, like telling me one of my app vars is undefined. What
it feels like is happening is that the CFC that accesses app_vars (whose "get"
method is called 25-30 times/page), which is saved in the app scope, but
accessed via a request pointer ( request.appAccessor..get("varName") tries to
access application vars, while another page request may be refreshing the app
vars or calling that same "get" method that this request is calling and an
error is thrown that the var is not defined (although all setting of app vars
is locked exclusively and all retrieval is also locked read-only and at no
point do I set Application = structNew() or anything).
Has anyone ever experienced anything like this? I'm hoping there is some basic
technique that I am missing for keeping cfc's and their method invocations from
interfering with others running in the request/session/app/server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing lists
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331201
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4