Tuesday, March 30, 2010

Bogus/Impossible Errors? Part 1

Has anyone experienced seemingly impossible errors in CF8? I've been a CF developer for nine years now, recently started a new job where we use CF8. We use onError() in Application.cfc to catch and report errors via email. We're experiencing a number of situations where the error just seems bogus.

Here's the simplest example:

Code:

%26lt;cfif isdefined('s.business_id') AND s.business_id EQ 0%26gt;

Error:

Element BUSINESS_ID is undefined in S.

This particular bit of code executes probably 500,000 times a day. We get anywhere from 20-30 error emails per day and can never reproduce the error. It's quite annoying and totally baffling.

Things we've tried:

  • putting the isdefined() condition in its own %26lt;cfif%26gt;, and nesting the second condition within it
  • using structkeyexists() instead of isdefined()
Bogus/Impossible Errors? Part 1

[Been doing CF development same amount of time as you - started back with CF5 in 2000 as a matter of fact.]

No help for you except to say that I've experienced exactly the same errors when attempting to combine cfif IsDefined() AND/OR - sometimes with parentheses and sometimes the same only cfif NOT IsDefined().

It's exasperating - telling me that one of the elements doesn't exist, when it matter of factly does.

Unlike you, I've been able to solve it every time by just nesting the cfif IsDefined() statements instead of trying to put them all in one statement.?It's been so bad I've pretty much just started nesting them without even trying to put them all together.

Bogus/Impossible Errors? Part 1

By any chance is s a shared scope or in a shared scope ? (application,

session, server ?) If yes then it might be a race condition.

Mack

  • beauty tips
  • No comments:

    Post a Comment