coldfusion - Possible race condition with var scope singleton? -



coldfusion - Possible race condition with var scope singleton? -

i have possible race status application scoped singleton. however, thought defining function level variable not 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 possible displayuuid.cfm not display uuid in url?

the problem going found in code have not shared, included via displayuuid.cfm file. code within displayuuid not thread safe (i guessing). code needs utilize "var" localize variables--or--prefix references "local." ensure local scopped.

bottom line: when utilize cfinclude within function included code must thread safe.

coldfusion

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -