Application Variables and Multiple Instances
Thursday, September 2, 2004 at 12:36PM Our development server runs two server instances of ColdFusion MX. Our producton server also did for awhile, but we had to return to single instance.
I have taken to instantiating CFC objects in the application scope for utlility objects. These objects are tied to whatever server instance they are created on. When I write code that updates the object, the udpate seems to take only on whatever server instance I happen to be tied to. If you are tied to another instance, you could get an "out of date" copy of the object instance, and get an error. I think this would also be true for server-scoped objects as well. Session objects are not as prone to this because of their transitory nature.
Server instance issues can be difficult to debug. A coworker has shared this bit of code that outputs the server instance name:
<cfobject action="create" type="java" class="jrunx.kernel.JRun"
name="objRun">
<cfset servername = objRun.getServerName()>
<cfoutput>JRun Server Name: #servername#</cfoutput>
Of course, all of this will go away with the simplified management of and consistent treatment of multiple instances in Blackstone....right?
Reader Comments