cache="False" CFC annotation causes model to still be cached?

Hi,

Wondering if I'm misunderstanding something or if this is a bug. I'm
experiencing a situation where objects annotated with cache="false" in
the CFC and called using getModel() are still being cached.

B. Results

When I look at the cachebox content report, an entry exists for
"wirebox:wirebox-dostuffmodel". As I refresh the page, the "hits"
value for that object increases. In other words, the object is cached
even though it has the cache="false" annotation.

Now, if I remove cache="false" completely from the CFC, then it's not
cached and doesn't even appear in the cache box content report.

In both cases, the object exists in the RC as expected.

A. Setup

1. Start with the advanced application template (no inheritance)

2. Add the binding below you Wirebox.cfc

map("doStuffModel").to("model.doStuffModel");

3. Create a "doStuffModel" CFC in the "model" folder with the
following code

<cfcomponent cache="false">

  <!----------------------------------- CONSTRUCTOR
--------------------------------------->
  <cffunction name="init" access="public" returntype="any"
output="false" hint="constructor">
    <cfreturn this>
  </cffunction>

</cfcomponent>

4. In the "General" handler, "index" action, add a "getModel()" call
to our object

<cfset RC.myModelThatDoesThings = getModel("doStuffModel")>

5. Reinit the app

Thank you,
Gabriel

I’d have to check the code, but I know other properties such as “singleton” are not evaluated for their value on their presence. Cache likely falls under the same rules.

Docs say its type is boolean. "Singleton" has no type. Although it's
possible the docs are out of date. If not evaluated, would that make
cache and singleton synonymous?

cache boolean Marks a component to be cached in CacheBox in the
default provider.
http://wiki.coldbox.org/wiki/WireBox.cfm#Component_Annotations

I ended up removing cache="false" for now so that I can resume
testing. If a bug, it's nasty in that it turned all my transient
objects into singletons.

Thank you,
Gabriel

From what I can tell the cache="false" is still very valid, is it possible
that the object it is inherited in or DI'ed into is either cached or been
created as a singleton?

Regards,
Andrew Scott
http://www.andyscott.id.au/

From: coldbox@googlegroups.com [mailto:coldbox@googlegroups.com] On
Behalf Of Dorioo
Sent: Monday, 11 April 2011 9:21 PM
To: coldbox@googlegroups.com
Subject: Re: [coldbox:9378] Re: cache="False" CFC annotation causes model
to still be cached?

Docs say its type is boolean. "Singleton" has no type. Although it's

possible

the docs are out of date. If not evaluated, would that make cache and
singleton synonymous?

cache boolean Marks a component to be cached in CacheBox in the
default provider.
Introduction | ColdBox HMVC Documentation

I ended up removing cache="false" for now so that I can resume testing. If

a

bug, it's nasty in that it turned all my transient objects into

singletons.

presumably cached. But it uses a getModel() call to get the object
each time.

<cfset RC.myModelThatDoesThings = getModel("doStuffModel")>

In M5 (previous version I used), the getModel() call would give me a
transient with cache="false" on it.

- Gabriel

Let me check that to see if that still holds

Luis Majano
President
Ortus Solutions, Corp

fixed and on the dev branch.

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com