This content has been marked as final.
Show 7 replies
-
1. Re: cf 8 .net
Newsgroup_User Jan 30, 2009 6:28 AM (in response to craig_mac)craiglaw98 wrote:
>
> i was wondering if i could do somethig sql side of things? i am using sql
> express 2008
>
I do not know explicitly for SQL Express 2008, but yes many modern
Database Management Systems have the ability to out XML directly. I am
sure it would be worth checking with some SQL Express 2008 documentation
or resources to see if it is one.
-
2. Re: cf 8 .net
craig_mac Jan 30, 2009 10:27 AM (in response to Newsgroup_User)Hi is there a better way to handle this task?
basically what i need is this
1. if there are any entries in the table send out an xml file to a url
2. then delete the current row
10,000 records takes a long time, i need to speed this process up somehow? -
3. Re: cf 8 .net
JR "Bob" Dobbs-qSBHQ2 Jan 30, 2009 1:07 PM (in response to craig_mac)Can you post your code, including database structure if applicable? -
4. cf 8 .net
craig_mac Feb 1, 2009 7:11 AM (in response to JR "Bob" Dobbs-qSBHQ2)Hi yes my code is simple, there is more content in the xml but dont think its required for this
<cfloop query="qGetMessages">
<cfset strURL = (" http://www.url.com") />
<cfsavecontent variable="strXML">
XML=<message>#qGetMessages.Info#</message>
</cfsavecontent>
<cfhttp url="#strURL#" method="POST" useragent="#CGI.http_user_agent#" result="objGet">
<cfhttpparam type="XML" value="#strXML.Trim()#" />
</cfhttp>
<!--- DELETE CURRENT MESSAGE FROM TABLE--->
<cfstoredproc procedure="sp_DeleteXML" datasource="#application.ds#">
<cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" dbvarname="MessID" value="#qGetMessages.ID#" null="No">
</cfstoredproc>
</cfloop> -
5. Re: cf 8 .net
JR "Bob" Dobbs-qSBHQ2 Feb 1, 2009 7:16 AM (in response to craig_mac)Is it possible to batch all the query results into a single XML document to be posted? This could be an improvement over 10k records being looped over. -
6. Re: cf 8 .net
craig_mac Feb 1, 2009 7:30 AM (in response to JR "Bob" Dobbs-qSBHQ2)Hi
Many thanks for your reply, yes i could do that, but i would need to resolve my other post first, checking if the scheduled task is already being run, as if i do as you surgested, and another schedule starts this could cause duplictes being sent. -
7. Re: cf 8 .net
JR "Bob" Dobbs-qSBHQ2 Feb 1, 2009 7:47 AM (in response to craig_mac)A couple of ideas to avoid overlapping the execution of your scheduled tasks. Note that I haven't tested any of these ideas.
1. Reset the schedule every time the task is run. The first action of the scheduled task is to set it's interval to daily and start time to 6 hours in the future. The last action of the scheduled task is to reset the schedule to the normal value.
2. Use an application scope variable. The first action of the task is to check a variable Application.IsMyTaskRunning. If the value is defined and true this means the task is already being executed so no work is done and the task is finished. If the value undefined or false the task sets the value to true then runs normally. On completion the value is set to false.