Skip to content

Cache Model Initialization turned off creates race condition #432

@jduteau

Description

@jduteau

With cacheModelInitialization set to false, every onRequestStart will clear the model initialization cache (wheels/events/onrequeststart.cfm:84) which does a StructClear on application.wheels.models (wheels/global/internal.cfm:811). Unfortunately, there are a bunch of accesses to application.wheels.models that assume that the model exists in the cache by the time they are called. The specific one that is causing errors in our project is in $initModelObject in wheels/model/initialization.cfm (line 237 is the culprit). $initModelObject is assuming that model("XXX") has been called and that the model with name 'XXX' will be found in application.wheels.models. It has a bare struct reference: object = application.wheels.models[arguments.name] which fails if, between the time that the model object was accessed and the time that this method executes, the model cache has been cleared.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions