• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

cf 8 .net

Guest
Jan 30, 2009 Jan 30, 2009

Copy link to clipboard

Copied

Hi i 2 question re cf 8

1. is it possible to create a asp.net user control and then call it via cfinclude?

2. i have a scheduled task running every 61 seconds, this task loops through a sql server database table and for each record it posts info to a xml url, then deletes that current record.

this works fine, but i am started to sometimes get up to 10,000 records inserted at one time which can be slow, i am just wondering if there is a better way to do this, ie is schedule task the way to go?

basically any record that gets inserted into this table must be then posted as xml then deleted.

i was wondering if i could do somethig sql side of things? i am using sql express 2008
TOPICS
Advanced techniques

Views

634

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 30, 2009 Jan 30, 2009

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 30, 2009 Jan 30, 2009

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jan 30, 2009 Jan 30, 2009

Copy link to clipboard

Copied

Can you post your code, including database structure if applicable?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 01, 2009 Feb 01, 2009

Copy link to clipboard

Copied

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>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Feb 01, 2009 Feb 01, 2009

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 01, 2009 Feb 01, 2009

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Feb 01, 2009 Feb 01, 2009

Copy link to clipboard

Copied

LATEST
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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation