I have a possible race condition with an application scoped singleton. However, I thought that by defining a function level variable that this would not be a problem.
<!--- Calling page --->
<cfset url.UUID = createUUID() />
<cfset application.UUIDBot.displayUUID() />
<!--- UUIDbot --->
<cfcomponent>
<cffunction name="displayUUID">
<cfset var rc = {} />
<cfset rc.position = url.uuid />
<cfinclude template="displayUUID.cfm" />
</cffunction>
</cfcomponent>
<!--- displayUUID.cfm --->
<cfoutput>#rc.position#</cfoutput>
Is it possible that displayUUID.cfm would not display the UUID in the URL?
The problem is going to be found in the code you have not shared, that which is included via the displayUUID.cfm file. The code within the displayUUID is not thread safe (I am guessing). That code also needs to use “var” to localize the variables–or–prefix your references with “local.” to ensure they are local scopped.
Bottom line: When you use cfinclude within a function the included code must also be thread safe.