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 should be 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. Then, why am I getting that  message?
 
Why am I not getting a transaction success message(The record was saved 
successfully) 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 instead of a transaction success message?
 
Can I do a run time debugging of the CFC using Coldfusion Builder as I can for 
Flex source files using the Flexbuilder?
 
Any advice would be welcome.


      


-------------------------------------------------------------
To unsubscribe from this list, simply email the list with unsubscribe in the 
subject line

For more info, see http://www.affug.com
Archive @ http://www.mail-archive.com/discussion%40affug.com/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------

Reply via email to