On Tue, May 20, 2008 at 9:21 PM, James Holmes <[EMAIL PROTECTED]> wrote:
> The sessionGateway is being called because cfparam evaluates the
> default argument whether or not it needs to assign it to something.

Isn't that kind of dumb?  Everything I've thought about cfparam since
I first learned of it was that it essentially was the same as doing an
"if this doesn't exist, then set it to this default" without it
actually evaluating the default if it wasn't necessary. My whole world
view has been turned upside down.

 Thanks, though. I'll have to keep that mind in the future.

> Does your sessionGateway's getById() method automatically assign
> session.userBean or does it only return a value? Is it perhaps writing
> over a value passed by reference instead of value?

It returns a bean object. But, if the passed in value is 0 [as it is
with the default in the cfparam], the bean gets init-ed and returned.
The init is what's setting all the default values. (that init was one
of the things that was changed as part of the rollout last week -- it
was part of a process to try to help performance by only instantiating
our CFCs once, instead of every time it was called.)

For now, I guess I'll stick with my workaround.

-- 
-----------------------------------------
Scott Brady
http://www.scottbrady.net/

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305817
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to