Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Remoting / November 2005



Tip: Looking for answers? Try searching our database.

Change to CFC not effective w/o CF server restart?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
relse - 03 Nov 2005 02:03 GMT
I'm learning Flash Remoting by working with the Real Estate sample app on the
CF Developer Center. Everything works fine, except that if I make a change to
the CFC that accesses the database (such as changing the query, etc), it has no
effect in the applicationunless I stop/start the CF Server service. I can
reload the home page (and get the "initializing" message), start a new browser
session - nothing shows me the change unless I restart the CF service. The CFC
is instantiated in Application.cfm inside a <cffunction
name="OnApplicationStart"> tag.  

It's as if the CFC is cached, and a new instance is not being created when I
reload the page, or even if I restart the browser.

There must be a way around this - otherwise each edit/test cycle is VERY
tedious - I must be missing something - help!

Thanks,
Robert
Brian Hogue - 03 Nov 2005 16:51 GMT
Robert -

Your issue is not the CFC. I know of only two ways to get the new
Application information into use. One, wait a LONG time. Two, stop and start
CF. Can you invoke this CFC outside of OnApplicationStart? hth

-brian

> I'm learning Flash Remoting by working with the Real Estate sample app on the
> CF Developer Center. Everything works fine, except that if I make a change to
[quoted text clipped - 13 lines]
>  Thanks,
>  Robert
relse - 04 Nov 2005 21:31 GMT
HI Brian - meant to get back to you yesterday - thanks for the tip - that led
me to a better understanding of what is really going on. I've used CFC's, but
never loaded them in the  Application scope - that's why I couldn't understand
the behavior.

Thanks,
Robert
JadeBlue - 04 Nov 2005 10:22 GMT
Robert,
The CFC is cached in the application scope when the application gets
initialized.
If you are making changes to the cfc, you can move this line in
Application.cfc:
<cfset application.listingGateway =
createObject("component",variables.componentPath &
".components.ListingGateway").init(variables.dns) />

to the onRequestStart function, a couple of lines below it (line 20).
By doing that, you will instantiate a new component every time you call a page.
I recommend that you put it back when you are finished.

Cheers,
Laura
relse - 04 Nov 2005 21:29 GMT
Laura - Thank you so much. I had a misunderstanding of the duration of the Application scope.  

Regards,
Robert
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.