Hi Group,
I know it is a Flex group, but since Flex and Coldfusion are used
together a lot so I thought someone here can help me out.
My application has a Coldfusion component(cfc), CFM file and a lot of
Flex source files.
I tried using <cftry>, <cfcatch>, <cfdump> to find the errors in the
cfc, but still cannot trace the issue.
The code in CFC file is somewhat like
<cfcomponent>
<cffunction name="edit" access="remote" returntype="any">
<cfargument name="form_data" type="struct">
<cftry>
<cftransaction>
<!--- Update Record --->
<cfquery datasource="#Application.ds#">
some SQL here
</cfquery>
<!--- Remove all previous outcomes --->
<cfquery datasource="#Application.ds#">
some SQL here
</cfquery>
<!--- Log Update --->
<cfquery datasource="#Application.ds#">
some SQL here
</cfquery>
<!--- Get Last Logged Record --->
<cfquery datasource="#Application.ds#"
name="getLogLastRecord">
some SQL here
</cfquery>
<cfloop index="arr_index" from="1"
to="#ArrayLen(form_data.num)#">
<!--- Update Record --->
<cfquery datasource="#Application.ds#" >
some SQL here
</cfquery>
<!--- Log Update --->
<cfquery datasource="#Application.ds#" >
some SQL here
</cfquery>
</cfloop>
</cftransaction>
<cfset result['statMsg']= "The record was saved
successfully!">
<cfset result['status']= true>
<cfcatch><!--- Catch error --->
<cfsavecontent variable="contentSaver">
<cfdump var="#form_data#">
<cfdump var="#cfcatch#">
</cfsavecontent>
<cffile action="write" file="#ExpandPath('.')#
\debug.html" output="#contentSaver#">
<cfset result['statMsg'] = cfcatch.Message>
<cfset result['status']= false>
</cfcatch>
</cftry>
<cfreturn result>
</cffunction>
</cfcomponent>
Issue: 1 My understanding is if the transaction is successful I should
get the message "The record was saved successfully!" which I don't
get, though the transaction is successful as the data is saved in the
MySQL backend.
Even if the transaction failed, I should get a message due to the
catch block.
What could be the reason I am not getting the message? The users of
the application need to get this so that they know that the changes
they did are saved.
Issue 2: For another transaction, I get the below message at run time.
"You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near '@domain.com' at line 3"
The transaction goes through fine and changes are saved to the back
end database which means nothing is wrong in my SQL syntax.
I don't see anything wrong on line 3 of the cfc file, nor the third
line of the SQL statement has anything missing. Why am I getting that
message?
Why am I not getting a message when I should for Issue 1 when the
transaction is successful and why am I getting a strange error message
for Issue 2 though the transaction is successful?
Can I do a run time debugging of the CFC using Coldfusion Builder as I
can for Flex source files using Flexbuilder?
Any advice would be welcome.
--
You received this message because you are subscribed to the Google Groups "Flex
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/flex_india?hl=en.