Ticket #368 (closed defect: fixed)
Errors during MG setup can 'ruin' an application
| Reported by: | cfjedimaster | Owned by: | boomfish |
|---|---|---|---|
| Priority: | high | Milestone: | 3.1 Maintenance Beta |
| Version: | 3.0.178 | Severity: | blocker |
| Keywords: | Cc: |
Description
The summary describes it well, but in general, if something goes wrong during the first hit to a MG app, it will be broken (known events won't work) until you reinit. Dennis Clark discovered the core of the issue and described a fix:
In MG3 the framework is not fully loaded all at once. Instead, the framework is bootstrapped with only the core event handlers, and controllers for those event handlers complete the different tasks required for loading the rest of the framework. One of these tasks (done in the initialization phase) is to put the framework into the application scope.
The problem is that if an exception such as a request timeout occurs after the framework is put into the application scope but before the framework is fully loaded, the framework is left persisted in an incomplete state. The application will then be stuck with a partially loaded framework object until the next init.
My suggestion for the MG team is to move the code that puts the framework object into the application scope from the initialization phase to the termination phase (which is currently commented out in the source). This has the side-effect of reloading the framework on every request until it can complete a request successfully. I would consider this side-effect a bonus feature: if my first request after an init fails I'm likely to want to re-init anyway.
While I'm at it, I have another suggestion for the MG team: remove the cflock from ModelGlue?.cfm, the MG3 framework bootstrapper doesn't need it.
![(please configure the [header_logo] section in trac.ini)](/ModelGlue.com/trac.cgi/chrome/site/your_project_logo.png)