Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

chschedule won't set application variable?

Status
Not open for further replies.

anorakgirl

Programmer
Jun 5, 2001
103
GB
Hi,

I have an hourly task (cfschedule) which gets some data via an cfhttp to another website. It then puts this data in an application variable. The problem is that the application variable isn't remembered. For example, in my task I currently have:
Code:
<cfset application.exchangeDate = "test">
If I run the task manually, using
Code:
<cfschedule action="RUN" TASK="#mytask#">
then in the debug output, I can see that the application variable has been set correctly.

But if I then click to another page in my site, it has gone. Has anyone had this problem? Does this mean that cfscheduled task doesm't run in the same application or something??

Thanks for any tips. Tamsin

~ ~
 
the page that is run by cfschedule,
make sure it is in a folder that has an application.cfm file which turns session management on. be sure sessions last at least 1 hour if your task is hourly. or you can put the <cfapplication> tag in the page that is run in the schedule to set the application name and session management.

Something like this would be better done storing the info into a db table and accessed when needed, not an application variable

A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.
-Douglas Adams (1952-2001)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top