This content has been marked as final. Show 4 replies
I do something similar to this all the time on my application that uses Oracle. You could have the gui prompt the user to submit the 40 datapoints via forms, etc., and populate a table in the database with the data and a status of 'submitted' etc. Then, I would have a background process (stored procedure, etc.) that runs every 'x' minutes which scans for work to do by looking for the submitted status. The stored procedure would then perform whatever activity that you wish on the pending jobs, then end by setting the job status to 'complete', or 'error', or whatever you want to use to track completed or failed jobs. Your client can then check to see if his or her job completed by accessing a page that check the status of the submitted job, etc. Works great, especially if you have process that take too long to hold up a web page.
1. Receive form.
2. Execute CFHTTP with form fields using timeout 0 to "background" template. Ignore timeout error.
3. Continue (redirect, if you wish)
Client-side (may vary, but this is an idea):
1. Create invisible frame.
2. When user hit "Submit" use JScript to grab parameters and submit 2 forms: one for background, another to continue.
> Obviously scheduled tasks are
> done in the background, but they are using a different session. Could I do a
> cflocation then then cfmodule and call the data submission template? Ideas are
> welcome, thanks!
Crikey. Nothing as complicated as all that.
Just use CFTHREAD:
(or on pre-CF8, use the async gateway).
Thank you everyone!
I think Adam's answer makes the most sense, especially since paross' idea was shot down when I suggested it to my boss a few days ago, but I'm glad I got that because it's always good to know your ideas are shared by people more knowledgeable that yourself.
I've done a little research and found cfthread to be exceptional, but I haven't found a way to do inline code. It works really well when a template is called though. I don't even know if it can do inline code. The livedocs suggest it can but Forta, Camden, etc. don't have examples like that.
I've posted a followup query here: http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=1&catid=7&thr eadid=1335607&enterthread=y in case anyone has any ideas. It's related, but I thought it merited a new thread :)