Clipped from the "Re: [CFCDev] Why we need the ability to use a path to specify the location of a CFC we want to call (long)" thread:
I know you can "sort of" get around this by not specifying any path for the CFC (in which case CF won't use the mappings)
This isn't safe either, whatever notation you use for calling the CFC another app may use the same notation trying to call a totally different file, CF Server will cache the location of the first CFC it finds and you are doomed...
This is something I've heard before, but cannot find any documentation on. I just ran a test and can't get this cached cross-over problem to happen. Here's my test:
1) I create two components, each with the same name and each with a single method, getFoo. getFoo returns some static text.
2) I place one component in one application at D:\web\test_app_one\application\objects\crossover_test.cfc and edit it to return "test_app_one" (the directory D:\web\test_app_one\ is the webroot for the site)
3) The other component goes in another application at D:\web\test_app_two\application\objects\crossover_test.cfc and edit it to return "test_app_two"
4) at the root of each app, I create a cfm that calls the component's getFoo method and outputs the result. The method is called in two ways, both identical under each app:
<cfinvoke component="application.objects.crossover_test" method="getFoo" returnvariable="RootFoo" />
<cfdump var="#RootFoo#" label="RootCFC getFoo() dump" />
<cfset RootCFC = createObject("component", "application.objects.crossover_test") />
<cfdump var="#RootCFC.getFoo()#" label="RootCFC getFoo() dump" />
To my understanding of this problem, because CF caches the compiled class equivalent of each component as application.objects.crossover_test then after I hit the first test page it will be cached. When I hit the second test page, I should see the results from the first -- the wrong results.
But this isn't happening. I get the correct results every time. Not that I want my stuff to break, but if I can't understand the problem then how can I know that I'm avoiding it in the future?
--
Ben Curtis
WebSciences International
http://www.websciences.org/
v: 310 478 6648
f: 310 235 2067----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
