ColdFusion timeout error

I have a scheduled task that runs once a day that creates an XML file that I transfer to another group. Recently, the amount of data has increased significantly and now causes the task to time out (I think). I tried to optimize my script as much as possible, but no luck. This lasts long before the hour, and I am not getting any ColdFusion error. Instead, I get the message "This page cannot be found" after it starts.

  • Could this be a timeout somewhere other than Coldfusion?
  • Is there a more efficient way to create this XML file?

File:

<cfsetting requesttimeout="7200">
<cftry>
    <cfquery datasource="datasource" name="getPeople">
        select PersonID, FirstName, LastName
        from People
    </cfquery>
    <cfquery datasource="datasource" name="getDepartments">
        select d.DepartmentID, DepartmentName, pd.PersonID
        from Department d inner join PersonDepartment pd on d.DepartmentID = pd.DepartmentID
    </cfquery>
    <cfquery datasource="datasource" name="getPapers">
        select PaperID, PaperTitle, PaperDescription, pp.PersonID
        from Paper p inner join PersonPaper pp on p.PaperID = pp.PaperID
    </cfquery>
<cfsavecontent variable="theXML"><?xml version="1.0" encoding="utf-8" ?><people>
<cfoutput query="getPeople"><cfsilent>
        <cfquery dbtype="query" name="getPersonDepartments">
        select DepartmentID, DepartmentName
        from getDepartments
        where PersonID = #getPeople.PersonID#
        </cfquery>
        <cfquery dbtype="query" name="getPersonPapers">
        select PaperID, PaperDescription
        from getpapers
        where PersonID = #getPeople.PersonID#
        </cfquery>
        </cfsilent> <person>
        <person_id>
            #getPeople.PersonID#
        </faculty_id>
        <person_first_name>
            #getPeople.Firstname#
        </person_first_name>
        <person_last_name>
            #getPeople.LastName#
        </person_last_name><cfif getPersonDepartments.recordcount gt 0>
        <departments><cfloop query="getPersonDepartments">
            <department>
                <department_id>
                    #getPersonDepartments.DepartmentID#
                </department_id>
                <department_name>
                    #getPersonDepartments.DepartmentName#
                </department_name>
            </department></cfloop>
        </departments></cfif><cfif getPersonPapers.recordcount gt 0>
        <papers><cfloop query="getPersonPapers">
            <paper>
                <paper_id>
                    #getPersonPapers.PaperID#
                </paper_id>
                <paper_description>
                    #getPersonPapers.PaperDescription#
                </paper_description>
            </paper></cfloop>
        </papers></cfif>
    </person>
</cfoutput></faculty>
</cfsavecontent>
<!--- Generate the file that contains the RSS --->
<cffile action="write" file="#application.serverroot#/People.xml" output="#theXml#" nameconflict="overwrite">
<cfcatch>
<cfdump var="#cfcatch#">
</cfcatch>
</cftry>
Done!
+3
source share
2 answers

. , , Coldfusion, "" , . 1GB + XML, , .

, ?

  • , .

  • CF- , , . ( , , jrun , cfadmin)

  • , xml, . XML node. , .

, http://www.carehart.org/cf411/

XML, / . , .

+3

( ), , - / :

SELECT
    r.session_id AS spid
        ,r.cpu_time,r.reads,r.writes,r.logical_reads 
        ,r.blocking_session_id AS BlockingSPID
        ,LEFT(OBJECT_NAME(st.objectid, st.dbid),50) AS ShortObjectName
        ,LEFT(DB_NAME(r.database_id),50) AS DatabaseName
        ,s.program_name
        ,s.login_name
        ,OBJECT_NAME(st.objectid, st.dbid) AS ObjectName
        ,SUBSTRING(st.text, (r.statement_start_offset/2)+1,( (CASE r.statement_end_offset
                                                                  WHEN -1 THEN DATALENGTH(st.text)
                                                                  ELSE r.statement_end_offset
                                                              END - r.statement_start_offset
                                                             )/2
                                                           ) + 1
                  ) AS SQLText
    FROM sys.dm_exec_requests                          r
        JOIN sys.dm_exec_sessions                      s ON r.session_id = s.session_id
        CROSS APPLY sys.dm_exec_sql_text (sql_handle) st
    WHERE r.session_id!=@@SPID
+1

Source: https://habr.com/ru/post/1744209/


All Articles