ColdFusion onRequest method & site-wide error handler quirk

One of our clients uses a site-wide error handler to catch errors and perform cleanup of com and Java objects. Recently an onRequest handler was added to the Application.cfc file and we found that the cleanup was no longer being performed.

The cleanup code referenced objects in the local / unnamed scope. Without an onRequest handler we had access to this scope & all object created on any page on the site that threw an error. The onRequest changed things, so we no longer had access to these objects in the unnamed scope (we still have an unnamed scope, but it’s empty).

The solution was to store these objects in the request scope, which the site-wide error handler does have access too.

About the Author

1 comment so far

  1. Gravatar
    Joshua  |  October 2nd, 2008 at 12:01 pm said:

    i’ve had that same problem, annoying huh?

Leave a Reply

Izilla Pics

  • Mark
  • Lisa
  • Mark
  • Llew
  • Andrew
  • Andrew
  • Adele and Matthew
  • Stephen
  • Matthew
  • Mark

Izilla

Established in August 2000, Izilla Pty Ltd is one of Australia's fastest growing technology companies.

It is one of the most experienced internet solutions companies in the country with more than 20 staff based in Sydney and Newcastle.