On Friday, Sep 5, 2003, at 12:23 US/Pacific, Joe Eugene wrote:
If the Class gets loaded only once, then i should get the correct object count.

Yes, sort of. If you have multiple class loaders active, a class can be loaded more than once and new static variables are created each time (so your objectCount is correct per-loader, not per-JVM). This is a basic feature of how Java works. Normally, you don't have multiple class loaders of course so you never notice.


Why do you get 'strange' behavior in CF? Because it uses multiple class loaders. Why does it use multiple class loaders? Because we want CF to dynamically recompile and reload classes. You can't unload an old version of a class without unloading the class loader that created it - and you can't unload a class loader until all instances of all classes that it loaded have become 'unreachable' (i.e., ready for garbage collection). If you have a CFC instance in a shared scope, it won't become unreachable and so you can't unload the class loader and therefore you can't load a new version of the CFC unless you create a new class loader.

BTW, I just had my wife read this (she's not a programmer) to make sure it's clear... and she understood it!

Sean A Corfield -- http://www.corfield.org/blog/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' in the message of the email.


CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to