Ok, so I *might* have a solution. Someone on my QA team noticed that
they could reproduce the divide by zero error when they logged in, did a
ctrl-N to get a new window and then logged out of our site in ONE
window. When they hit refresh in the other window... crash boom bang.
I was looking at the sessions in memory with this code:
<cfset tracker =
createObject("java","coldfusion.runtime.SessionTracker")>
<cfoutput><p>There are #tracker.getSessionCount()# active
sessions</p></cfoutput>
<cfset sessions =
tracker.getSessionCollection(application.applicationName)>
<cfdump var="#sessions#">
And I noticed that many of the sessions were empty structs which
reminded me that our logout page runs this code:
<cflock scope="session" type="EXCLUSIVE" timeout="10">
<cfloop collection="#session#" item="deleteme">
<cfif not deleteme is "cfid" and not deleteme is "cftoken">
<cfset rc = StructDelete(session, "#deleteme#")>
</cfif>
</cfloop>
</cflock>
I commented out that code and sure enough the error went away.
I thought about using:
<cfset getPageContext().getSession().invalidate()>
But I have opted for:
<cfset session.setMaxInactiveInterval(0)>
Because it is my understanding that this tag will immediately time out
the current session and all memory being used by can be reclaimed.
And it keeps my divide by zero error from appearing.
I am very interested in why this error occurred though on multiple
instances sharing sessions between them.
Sounds like a BUG to me...
~Brad
-----Original Message-----
From: Brad Wood
Sent: Friday, March 30, 2007 4:20 PM
To: CF-Talk
Subject: divide by zero
A couple months ago Russ posted because he was getting an error "/ by
zero" and the line number pointed to his cfapplication tag.
http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:49144
It was determined that he was using multiple instances of CF on the same
server. At any rate, some of my coworkers are getting that now on my
new dev server (running three instances)
The only solution Russ posted was to put a try catch in and force the
user's session to expire.
I am following up to see if Russ or anyone else can report any better
workarounds or fixes for this problem.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 and Flex 2
Build sales & marketing dashboard RIAâs for your business. Upgrade now
http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274247
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4