私は求人サイトでフォームの「私たちに連絡する」種類を処理するCFCを持っています。 cfcはサイトからいくつかの異なる形式を扱うように設計されています。一般的な「私たちに連絡する」フォームと、もう1つの「私はこの仕事に興味があります。質問のあるCFCでの通信障害のリンク
CFCがデータを取得し、求人情報のID番号が引数に含まれている場合、CFCはクイッククエリを実行して求人情報を取得し、電子メールに含めてHR部門とユーザーを送信しますジョブの投稿情報とユーザーの連絡先情報が記載された電子メール。
IDが検出されない場合、CFCはユーザーに確認メールを電子メールで送信し、連絡先情報をHR部門に送信します。
汎用(非ID)フォームが処理されると、すべて正常に動作します。しかし、それは私がエラーを取得する迅速なクエリを含んでフォームを処理する時間が来るとき:
Communications link failure The last packet successfully received from the server was 61,380 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago.
なぜ私のページの作業罰金を移入したが、このCFCは、その中に、クエリでエラーがスロークエリではありません?
私たちは共有ホスティング環境でMYSQLを使用してCF9を実行しています。
CFC ...
<cfif len(local.data.job_id)>
<cftry>
<cfquery name="qJobsforEmail" datasource="#application.datasource#" username="#application.username#" password="#application.password#">
SELECT * FROM #local.data.table# WHERE #local.data.table#.#local.data.column#= <cfqueryparam value="#local.data.job_id#" cfsqltype="cf_sql_numeric">
</cfquery>
<cfcatch type="any">
<cfmail to="[email protected]" from="[email protected]" subject="Error processing query" type="html">
<h3>There was an error processing the query</h3>
<p><cfoutput>#cfcatch.Detail#</cfoutput></p>
<p><cfoutput>#cfcatch.NativeErrorCode#</cfoutput></p>
<p><cfoutput>#cfcatch.SQLState#</cfoutput></p>
<p><cfoutput>#cfcatch.Sql#</cfoutput></p>
<p><cfoutput>#cfcatch.queryError#</cfoutput></p>
<p><cfoutput>#cfcatch.where#</cfoutput></p>
<p><cfoutput>#cfcatch.type#</cfoutput></p>
<cfdump var="#local#">
</cfmail>
<cfset local.response["error"] = 'true'>
<cfset local.response["message"] = 'Error message to the page goes here...'>
<cfreturn local.response>
<cfabort>
</cfcatch>
</cftry>
<cftry>
<cfmail to="#local.data.email#" bcc="[email protected]" from="[email protected]" subject="Thank you for contacting us" type="html">
<h2>We’re glad you contacted us.</h2>
<p>Warm and fuzzy thank you message here</p>
<p>We received the following information on <cfoutput>#DateFormat(Now())#</cfoutput>, <cfoutput>#TimeFormat(Now())#</cfoutput>: </p>
<p>First Name: <cfoutput>#local.data.first_name#</cfoutput></p>
<p>Last Name: <cfoutput>#local.data.last_name#</cfoutput></p>
<cfif len(local.data.suffix)>
<p>Suffix: <cfoutput>#local.data.suffix#</cfoutput></p>
</cfif>
<p>Specialty: <cfoutput>#local.data.specialty#</cfoutput></p>
<p>Email Address: <cfoutput>#local.data.email#</cfoutput></p>
<p>Phone: <cfoutput>#local.data.phone#</cfoutput></p>
<p> Current City and State: <cfoutput>#local.data.city#</cfoutput></p>
<cfif len(local.data.comments)>
<p>Message: <cfoutput>#local.data.comments#</cfoutput></p>
</cfif>
<p style="border-top:thin dotted black;padding-top:20px;font-weight:bold;">This is the position you’re inquiring about:</p>
<p style="font-weight:bold;"><cfoutput>#qJobsforEmail.title#</cfoutput></p>
<p style="padding-bottom:20px;"><cfoutput>#qJobsforEmail.description#</cfoutput></p>
<p>Our Recruiter will review this information and get in touch with you as soon as possible. Please make sure your email or phone number listed above is correct.</p>
<p>Thanks again for contacting us. We look forward to speaking with you soon.</p>
</cfmail>
<cfcatch type="any">
<cfmail to="[email protected]" from="[email protected]" subject="Error processing email" type="html">
<h3>There was an error processing the email at</h3>
<cfdump var="#cfcatch.Detail#">
<cfdump var="#local#">
</cfmail>
<cfset local.response["error"] = 'true'>
<cfset local.response["message"] = 'message to return to the page...'>
<cfreturn local.response>
<cfabort>
</cfcatch>
</cftry>
<cfelse>
<!-- regular ol form process goes here -->
</cfif>
1 - 示唆したように、これはコードのエラーが、CFサーバとデータベースの構成ではありません。 – Nate
私はこの場所が大好きです。ありがとうございました。ありがとうございました。私は、私のホストに電話をして、それを調べるように頼んだ直後に、机の上で頭を打つのを止めて、血をきれいにします。 – Ofeargall
さらに、Pete Freitagに「あなたのコードに問題はないとは思わない」と言ってもらうことは、金印の検証のようなものです。私を暖かく幸せな中に入れてくれます。 – Ofeargall