« Uncovered | Main | XP SP2 - Oh, The Humanity »
Thursday
Sep022004

Application Variables and Multiple Instances

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

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>