CFTransaction/CFCatch/CFTry

I have an insert query that parses a large text file into a query object and then loops through it and inserts it into a data table.
However sometimes there are bad values are in the text file...like a text value  where a date should be etc.  or a nonnumeric value where a numeric should be.....  This causes the loo/ insert query to STOP.
If I get all good values I want the data to be inserted and have processing continue.
However If I get a bad value in the file I want all processing to stop and all of the prior inserted rows to be deleted and I want to get an error message emailed to me
How do I do this?
Here is the Cfloop and the insert query below..again the problem is that if I get a bad value I want processing to stop and the data table to rollback to the initial state prior to any processing.....and I want an email alerting me there was an issue ( I know how to use CFMAIL)
<cftransaction>
<cfloop query="stocks">
    <CFQUERY name="load_the_data" datasource="abc" >
    INSERT INTO portfolios_new (portfolio , portfolio_ID , load_date , ticker , cusip,BC1, BC1_ID , BC2 , BC2_ID , BC3 , BC3_ID, Load_ID)
VALUES ('#Portfolio#'
    ,'#PORTFOLIOID#','#loadDate#','#Ticker#','#Cusip#','#BC1#','#BC1Id#','#BC2#','#BC2Id#','# BC3#','#BC3Id#', '#next_load_id#' );
    </CFQUERY>
  </cfloop>
</cftransaction>

Dave,
I am going to look into this : That said, why not check the values as you're reading them in the first place? That way, you can avoid writing the rows to the database if there's a bad one.
But on this below...I guess instead of , I'd need to know if there was any kind of error.
Isn't there a way to do a cfif to see if there is any type of database error...or any kind of error for that matter
What would that CFIF look like?
<cfif >
Patrick Hutchinson
www.1design.com
Office:   804-360-0695
Cell:       804-370-6873
Email:     [email protected]

Similar Messages

  • CFTRY

    I'm curious why with this:
    <cftry>
    <cfquery name="AddRequest" datasource="SB">
    insert into inforeq
    (Cust_Name, Cust_Address, Cust_Address2, Cust_City,
    Cust_State,
    Cust_Zip, Cust_Email, Cust_MailInfo, Cust_Events, Cust_Class,
    Cust_Info_Sent, Cust_Newsletter,Cust_Beg_Class, Cust_Lat,
    Cust_Long)
    values
    (<cfqueryparam cfsqltype="cf_sql_varchar"
    value="#CapFirstTitle(strName)#">,<cfqueryparam
    cfsqltype="cf_sql_varchar"
    value="#CapFirstTitle(arguments.Address1)#">,<cfqueryparam
    cfsqltype="cf_sql_varchar"
    value="#CapFirstTitle(new_Address2)#">,<cfqueryparam
    cfsqltype="cf_sql_varchar"
    value="#CapFirstTitle(arguments.City)#">,<cfqueryparam
    cfsqltype="cf_sql_char"
    value="#ucase(arguments.State)#">,<cfqueryparam
    cfsqltype="cf_sql_varchar"
    value="#arguments.Zip#">,<cfqueryparam
    cfsqltype="cf_sql_varchar" value="#arguments.Email#">,
    <cfqueryparam
    cfsqltype="cf_sql_integer"
    value="#arguments.Info#">,<cfqueryparam
    cfsqltype="cf_sql_integer"
    value="#arguments.Events#">,<cfqueryparam
    cfsqltype="cf_sql_integer"
    value="#arguments.Class#">,<cfqueryparam
    cfsqltype="cf_sql_integer"
    value="#arguments.Info_Sent#">,<cfqueryparam
    cfsqltype="cf_sql_integer"
    value="#arguments.News#">,<cfqueryparam
    cfsqltype="cf_sql_integer"
    value="#arguments.Beg_Class#">,#mylat#,#mylng#)</cfquery>
    <cfcatch type="database">
    <cfset session.dbResult="#cfcatch.SQLState#">
    <cflocation url="../test101.cfm" addtoken="no">
    </cfcatch>
    </cftry>
    I'm not getting a result for #cfcatch.SQLState# ?? When I
    output the value
    of session.dbResult, its N/A.......
    This is on a MySql database..... if that helps

    It should be, I changed the datasource to something that
    didn't exist
    "Adam Cameron" <[email protected]> wrote in message
    news:1pufm20vo2uio.1izkqkkqhpsbn$.[email protected]..
    >> I'm curious why with this:
    >>
    >> <cftry>
    >> <cfquery name="AddRequest" datasource="SB">
    > [...]
    >>
    value="#arguments.Beg_Class#">,#mylat#,#mylng#)</cfquery>
    >> <cfcatch type="database">
    >> <cfset session.dbResult="#cfcatch.SQLState#">
    >> <cflocation url="../test101.cfm"
    addtoken="no">
    >> </cfcatch>
    >> </cftry>
    >>
    >> I'm not getting a result for #cfcatch.SQLState# ??
    When I output the
    >> value
    >> of session.dbResult, its N/A.......
    >>
    >> This is on a MySql database..... if that helps
    >
    > Well... is the query actually erroring?
    >
    > --
    > Adam

  • MM_XSLTransform.cfc error: cfcatch.Proc

    I've been using the MM_XSLTransform.cfc for a couple years to
    do XSL transformation on a site, and it's worked quite well. Only
    just last night, I started receiving an error regarding
    cfctach.Proc:
    Element PROC is undefined in CFCATCH. <br>The error
    occurred on line 135.
    As well as:
    Element PROC is undefined in CFCATCH. <br>The error
    occurred on line 133.
    The version of the CFC that I'm using is 0.6.2, which I
    believe is the version that comes with Dreamweaver 8. Not sure if
    there's a new version for Dreamweaver CS3 or Dreamweaver CS4, for
    that matter.
    In any case, the lines in question are as follows:
    <cftry>
    <cfset XMLParse(myFile)>
    <cfcatch type="any">
    <cfif type EQ "xml">
    <cfset setError(getErrorFromCode('MM_INVALID_XML_ERROR',
    errSrc) & cfcatch.Proc & ' ' & mySrc & '<br>'
    & cfcatch.Message & '<br>' &
    HTMLEditFormat(cfcatch.Detail) & '<br>' &
    HTMLCodeFormat(myFile))>
    <cfelse>
    <cfset setError(getErrorFromCode('MM_INVALID_XSL_ERROR',
    errSrc) & cfcatch.Proc & ' ' & mySrc & '<br>'
    & cfcatch.Message & '<br>' &
    HTMLEditFormat(cfcatch.Detail) & '<br>' &
    HTMLCodeFormat(myFile))>
    </cfif>
    </cfcatch>
    </cftry>
    This error could also potentially pop up in this section:
    <cftry>
    <cfset output = XmlTransform(Arguments['xml'],
    Arguments['xsl'])>
    <cfcatch type="any">
    <cfset
    setError(getErrorFromCode('MM_TRANSFORMATION_ERROR') &
    cfcatch.Proc & & '<br>' & cfcatch.Message)>
    </cfcatch>
    </cftry>
    In looking at the documentation for cfcatch, Proc (as in
    cfcatch.Proc) does not appear to be a valid attribute for cfcatch,
    and there isn't anywhere else within the cfc where Proc gets tacked
    on to the cfcatch.
    For now, to prevent the error from occurring, I've commented
    out all instances of cfcatch.Proc.
    Not sure why this popped up now. It may mean there's an error
    in one of my XML files, which I will need to investigate.
    If anyone has any insight to share on the perils of
    cfcatch.Proc, it would be appreciated.
    Thanks,
    Marc

    I am passing RequestTimeOut="120" in the url. The 120 seconds
    is the value that has been determined to be the maximum that we
    want the app to run before timing out. The issue I have is that the
    ColdFusion Blue Error page is not acceptable error handling and I
    have not been able to capture the timeout. That is my request, how
    to capture the timeout and follow acceptable error handling in this
    timeout situation.

  • Trying to CFCATCH an ill formatted date

    I need a date entered in this format
    05/21/2010
    I'm using this to catch if its entered improperly but its skipping the error instead
    <cftry>
    <cfset  bywhen = DateFormat("#FORM.date#", "mm/dd/yyyy")>
    <cfcatch type="any">
      Your date was not formatted properly. Please go back and try again.
    </cfcatch>
    </cftry>
    I also tried this on a cfquery with an incorrect SQL query and It's simply skipping the cfquery but not displaying the friendly message.
    So it seems to be working but not displaying the friendly messages.
    Could this be an administrator setting issue.

    Two of the reasons the code is not working are:
    <cfoutput>#DateFormat("31/12/2009",      "mm/dd/yyyy")#</cfoutput> will amend your string,      switching the month and day to result in 12/31/2009. So it will not      generate any error for strings entered as dd/mm/yyyy.
    Also a numeric entry will be      taken as a numeric representation of a date/time object and will therefore      be converted to a mm/dd/yyyy format. e.g. <cfoutput>#DateFormat(253698, "mm/dd/yyyy")#</cfoutput> will generate 08/06/2594.
    Some options:
    1.         You may need to test the form data
    Is it a date?
    10 characters long?
    Are the third and sixth characters "/"s?
    First 2 characters within range 1-12?
    Characters 4 & 5 within range 1-31 (except short months - note Feb in leap years)
    thereby ending up with something like
    <cfif isDate(form.date) AND len(trim(form.date) EQ 10) AND (mid(form.date,3,1) EQ "/") AND (mid(form.date,6,1) EQ "/") AND isValid("range",mid(form.date,1,2),1,12) AND isValid("range",mid(form.date,4,2),1,31)> (code not tested)
    2.         Provide calendar that user can click on to choose date. Date format is then set by you i.e. cfcalendar - default mask mm/dd/yyyy
    http://livedocs.adobe.com/coldfusion/8/htmldocs/Tags_c_02.html#3798877
    3.             Use <cfinput> tag with validate attribute
    http://livedocs.adobe.com/coldfusion/6.1/htmldocs/tags-p65.htm#wp1100379

  • Isstruct with cfcatch

    I have passed 'cfcatch' to a function and checked the argument with isstruct() and it retrurn 'NO'. Why the isstruct return false
    index.cfm
    <cfoutput>
        <cftry>
            <cfset t.a="Dileep">
            #isstruct(t)#<br />
            #getStruct(t)#<br />
            #getStruct1(t)#<br />
            <cfcatch >
            <br />
            <cfdump var="#cfcatch#">
            #getStruct(cfcatch)#
            </cfcatch>
        </cftry>
    </cfoutput>
    <cffunction name="getStruct">
        <cfargument name="test">
        <cfreturn isstruct(test)>
    </cffunction>
    out put
    YES
    YES
    struct
    Detail
    [empty string]
    ErrNumber
    0
    Message
    Variable GETSTRUCT1 is undefined.
    StackTrace
    coldfusion.runtime.UndefinedVariableException: Variable GETSTRUCT1 is undefined.      at coldfusion.runtime.CfJspPage._get(CfJspPage.java:325)      at coldfusion.runtime.CfJspPage._get(CfJspPage.java:287)      at cftest2ecfm1898925283.runPage(D:\Projects\Glasnost\Glasnost\Output\test.cfm:8)      at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:196)      at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:483)      at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)      at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:282)      at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)      at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)      at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)      at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:27)      at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)      at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:74)      at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:2 8)      at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)      at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)      at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)      at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)      at coldfusion.CfmServlet.service(CfmServlet.java:198)      at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)      at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)      at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42 )      at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)      at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)      at jrun.servlet.FilterChain.service(FilterChain.java:101)      at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)      at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)      at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)      at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)      at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)      at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)      at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)      at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)      at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
    TagContext
    array
    1
    struct
    COLUMN
    0
    ID
    LINE
    8
    RAW_TRACE
    at cftest2ecfm1898925283.runPage(D:\Projects\Glasnost\Glasnost\Output\test.cfm:8)
    TEMPLATE
    D:\Projects\Glasnost\Glasnost\Output\test.cfm
    TYPE
    CFML
    Type
    Expression
    name
    GETSTRUCT1
    NO

    OK. Thanks.
    But while 'cfdump' shows header as 'struct'. Please see the attched image

  • No Error Struct from CFCATCH

    Hello,
    I am having some weird issues with CFTRY/CFCATCH. I am getting an error that says, "Variable ERROR is undefined" when I run the following code. Why isn't my Error Struct available to dump like it normall is?
    Var 'test' is not defined so it should throw an error.
    <cfoutput>
        <cftry>
            #trim(test)#
            <cfcatch>
                <cfdump var="#error#">
            </cfcatch>
        </cftry>
    </cfoutput>

    No, I think you are just mixing the two. Error handling pages have always been different than cfcatch.
    http://livedocs.adobe.com/coldfusion/8/Tags_d-e_11.html#2022557

  • How do I do a runtime debug of a Coldfusion component file?

    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.

    hemant_k wrote:
    Yes, you can use debugger in ColdFusion Builder. Check http://help.adobe.com/en_US/ColdFusionBuilder/Using/WS0ef8c004658c1089 -31c11ef1121cdfd6aa0-7fff.html for some details.
    There are some interesting link around builder available on CF builder team blog - blogs.adobe.com/cfbuilder. [image links are not working becuase of admin issues]
    Thanks, that link is helpful.

  • What is it about CFFUNCTION that slows things down???

    I have some code that imports the contents of an Excel
    spreadsheet into my database, during the import process I also do a
    fair amount of data massaging. When I run this code straight from a
    URL it completes in about 90 seconds. When I encapsulate the exact
    same code into a CFC function and call it from my Flex application
    the run time jumps to around 10 minutes. Is there something about
    calling a CFC function from within Flex that I am missing here? The
    only differences in the code are a few passed in variables (which
    are hard coded in the URL version) and the CFFunction tags. The
    differences are trivial so I don't see how they could be accounting
    for the extra time.
    Any thoughts on why the CFC runs so much slower than the
    CFM??? Oh... I am running CF 7.02 and my client will be on that
    platform for the foreseeable future.
    Have an Ordinary Day...
    KomputerMan ~|:-)

    I think it is something to do with how the end of the
    function processes. I am able to watch the records get wrote into
    my database table. From the time the last record gets wrote to the
    time the end of the function is processed is about 19 seconds for
    500 records. That time goes up when more records are processed too.
    Here is the code at the end of my loop that processes the data
    prior to the end of the function. When the /CFLOOP is reached is
    when the last record is wrote to the table.
    <CFSILENT>
    <!--- bunch of code to import a spreadsheet and put it
    into a temporary database table so the data can be further
    manipulated. This is then followed by a bunch of code to do
    summations, groupings, create referential integrity, etc… and
    then put the clean data into a good data table and the bad data
    into a bad data table. --->
    <CFTRANSACTION>
    <cftry>
    <CFLOOP QUERY="GetData">
    <cftransaction action = "commit"/>
    </CFLOOP>
    <cfcatch type="database">
    <cfthrow message="function = ADD records, MyFlag =
    #MyFlag# #cfcatch.Message# #cfcatch.Detail#">
    </cfcatch>
    </cftry>
    </CFTRANSACTION>
    <!--- here is where I start my stop watch when the record
    count in my table quits incrementing --->
    </CFSILENT>
    <CFSET MyReturnString = GoodCnt & ',' & BadCnt1
    & ',' & BadCnt2 & ',' & BadCnt3>
    <CFRETURN MyReturnString>
    </CFFUNCTION>
    I have been playing with adding a CFTRANSACTION into the code
    to see if that helps or hurts. So far it has not made a difference.
    Bottom line is after the data is processed the function is not
    returning to Flex in a timely manner.
    Have an Ordinary Day...
    KomputerMan ~|:-)

  • Possible thread issue?

    I'v now come across a code problem that I simply cannot understand what is happending here.
    The code is part of a cfc module that is behind a web-service.
    The problem here is the transID.
    When you start putting a bit of load on this code, the transID gets mangled/confused/....
    When looking at the first cflog here, the trans id is the correct value is an thedatabase table.
    However, after the values are assigned to stTrans, the trans id is different! It is that of another tx that happend later on...
    Nowere is the transID updated in the code between the two cflog's. The value in the cflog is correct, as it is this value that I receive on the other side of the WebService module....
    Here is the logfile output
    Look for card no xxxx00213
    Information","jrpp-5","12/07/09","20:11:27","GCCSVPWS","Process tx for xxxxxxx00213 with tx id 163537 and Thread.txid is 163537"
    "Information","jrpp-0","12/07/09","20:11:27","GCCSVPWS"," Process tx (after transaction) for xxxxx000346 with tx id 163537 and Thread.txid is 163537"
    "Information","jrpp-4","12/07/09","20:11:27","GCCSVPWS"," Process tx (after transaction) for xxxx38304 with tx id 163537 and Thread.txid is 163537"
    "Information","jrpp-7","12/07/09","20:11:27","GCCSVPWS","Process tx for xxxxxxxx254"
    "Information","jrpp-9","12/07/09","20:11:27","GCCSVPWS","Process tx for xxxxxxx0270"
    "Information","jrpp-16","12/07/09","20:11:27","GCCSVPWS"," Process tx (after transaction) for xxxxxx005097 with tx id 163537 and Thread.txid is 163537"
    "Information","jrpp-18","12/07/09","20:11:27","GCCSVPWS"," Process tx (after transaction) for xxxxxx00239 with tx id 163537 and Thread.txid is 163537"
    "Information","jrpp-19","12/07/09","20:11:27","GCCSVPWS"," Process tx (after transaction) for xxxxxx00304 with tx id 163537 and Thread.txid is 163537"
    "Information","jrpp-8","12/07/09","20:11:27","GCCSVPWS","Process tx for xxxxxxxxx12 with tx id 163538 and Thread.txid is 163538"
    "Information","jrpp-9","12/07/09","20:11:27","GCCSVPWS","Process tx for xxxxxxxxx270 with tx id 163539 and Thread.txid is 163539"
    "Information","jrpp-3","12/07/09","20:11:27","GCCSVPWS"," Process tx (after transaction) for xxxxxxxx0288 with tx id 163539 and Thread.txid is 163539"
    "Information","jrpp-7","12/07/09","20:11:27","GCCSVPWS","Process tx for xxxxxxxxxxx254 with tx id 163540 and Thread.txid is 163540"
    "Information","jrpp-5","12/07/09","20:11:27","GCCSVPWS"," Process tx (after transaction) for xxxxxxxxxx0213 with tx id 163540 and Thread.txid is 163540"
    I found a problem when I did code optimizationon the other side of the webservice. First thought it was the web service, but trace it right down to this bit of code on the one server.
    This is happening on my Mac's VM's running CentOS 5.2 and Coldfusion 8 on top of that.....
    Coldfusion details:
    Server Product
    ColdFusion
    Version
    8,0,1,195765 
    Operating System
    UNIX 
    OS Version
    2.6.18-128.2.1.el5 
    JVM Details
    Java Version
    1.6.0_04 
    Database is MySQL version 5.0
    Any any any  ideas will be appreciated!
    snipped ----
                        SELECT last_insert_id() AS transid;
                    </cfquery>
                    <cfset theTransID = trans_insert.transid>
                    <cfset Thread.txid = trans_insert.transid>
                    <cflog file="transdao_cfc" text="Process tx for #cardnumber# with tx id #theTransID# and Thread.txid is #Thread.txid#" type="information">
                    <!--- Update acct balance on gateway --->
                    <cfquery datasource="#variables.dsn#">
                        UPDATE acct_balances
                        SET
                            acct_balance = acct_balance + #arguments.amount#,
                            acct_balance_available = acct_balance_available + #arguments.amount#
                        WHERE
                            acct_id = <cfqueryparam cfsqltype="CF_SQL_INTEGER" value="#arguments.acctid#">
                    </cfquery>
               </cftransaction>
                <!---------------------------------------------------------------------------
                CHECK FOR NEG to POS
                ---------------------------------------------------------------------------->
                <cftry>
                    <cfif theCurrentActualBalance LT 0 AND theNewActualBalance GTE 0>
                        <cfquery datasource="#variables.dsn#">
                            UPDATE fees_collection
                            SET
                                settled = <cfqueryparam cfsqltype="CF_SQL_INTEGER" value="1">,
                                settled_trans_id = <cfqueryparam cfsqltype="CF_SQL_INTEGER" value="#theTransID#">,
                                settled_dttm = NOW()
                            WHERE
                                acct_id = <cfqueryparam cfsqltype="CF_SQL_INTEGER" value="#arguments.acctid#"> AND
                                settled = 0
                        </cfquery>
                    </cfif>
                    <cfcatch type="any"><cflog file="transdao_cfc" text="#cfcatch.toString()#"></cfcatch>
                </cftry>
                <!--- Set response --->
                <cfset stTrans.responsecode = 00 />
                <cfset stTrans.transid = theTransID />
                <cfset stTrans.success = true />
                <cfset stTrans.message = "" />
                <cfset stTrans.start_actualbalance = theCurrentActualBalance>
                <cfset stTrans.start_availablebalance = theCurrentAvailableBalance>
                <cfset stTrans.end_actualbalance = theNewActualBalance>
                <cfset stTrans.end_availablebalance = theNewAvailableBalance>
                <cflog file="transdao_cfc" text=" Process tx (after transaction) for #cardnumber# with tx id #stTrans.transid# and Thread.txid is #Thread.txid#" type="information">

    I update the text fields in the following method :
    public void performSummaryCalculation() {
             CalcSheetTotals_IF calcSheetTotals = (CalcSheetTotals)CalcSheetTotalsGUITableModel.rowTotalsData[5];
             Double quotedPrice = calcSheetTotals.getQuotedPrice();
             log("quoted price to string = " + quotedPrice.toString());
             textField_calcSheetOriginalAmountOfClaim.setText("R " + quotedPrice.toString());
                //panel_calcSheetSummary.repaint();
             //textField_calcSheetOriginalAmountOfClaim.updateUI();
             //panel_calcSheetSummary.updateUI();
              textField_calcSheetOriginalAmountOfClaim.repaint();
        }

  • Review my Code

    Good everyone,
    Can someone look at my code to tell me if there is a way make it more compact. I want to stop users from entering the same data over and over.
    <cfif 'FORM.StartUnits' eq 0>
    <cflocation url="../errorPages/startunitsGTendunits.cfm">
    <cfelseif FORM.StartUnits GT FORM.EndUnits>
    <cflocation url="../errorPages/startunitsGTendunits.cfm">
    <cfelseif IsDefined('FORM.Workorder')>
    <cfelse>
    <cflocation url="../Production/workordersearch.cfm">
    </cfif>
    <cfset FORM.DelayTime = (FORM.DelayTimeHours + (FORM.DelayTimeMinutes/60)) >
    <cfset FORM.ProdTime = (FORM.ProTimeHours + (FORM.ProTimeMinutes/60)) >
    <cfset FORM.CoTime = (FORM.CoTimeHours + (FORM.CoTimeMinutes/60)) >
    <cfset FORM.UnitsProd = FORM.EndUnits - (FORM.StartUnits) + 1 >
    <cfparam name="FORM.WorkOrder" default="1">
    <cftransaction>
    <cftry>
    <cfquery name="insertProduction" datasource="#REQUEST.datasource#">
    IF NOT EXISTS
    select WorkOrder, StartUnits
    from tbl_Assembly_Production
    where workorder = '#FORM.Workorder#' and StartUnits = '#FORM.StartUnits#'
    BEGIN
    INSERT INTO tbl_Assembly_Production (dateProd, Shift, Area, Jig, EmpNo, WorkOrder, Item, Model, ProdTime, CoTime, startUnits, endUnits, NpTime, UnitsProd, ProdDelayTime, CoDelayTime, Comment)
    VALUES ('#Trim(FORM.dateProd)#',
            '#Trim(FORM.Shift)#',
            '#Trim(FORM.Area)#',
            '#Trim(FORM.jig)#',
            '#Trim(FORM.EmpNo)#',
            '#Trim(FORM.WorkOrder)#',
            '#Trim(FORM.Item)#',
            '#Trim(FORM.Model)#',
            '#Trim(FORM.ProdTime)#',
            '#Trim(FORM.CoTime)#',
            '#Trim(FORM.startUnits)#',
            '#Trim(FORM.endUnits)#',
            '#Trim(FORM.NpTime)#',
            '#Trim(FORM.UnitsProd)#',
            '#Trim(FORM.ProdDelayTime)#',
            '#Trim(FORM.CoDelayTime)#',
            '#Trim(FORM.Comment)#')
    END       
    </cfquery>
    Thank You. Work Order <cfoutput>#FORM.WORKORDER#</cfoutput> with Starting Unit <cfoutput>#FORM.StartUnits#</cfoutput> has already been entered. You can enter this unit only once!!!.
    <cfcatch type="database">
    Work Order <cfoutput>#FORM.WORKORDER#</cfoutput> with Starting Unit <cfoutput>#FORM.StartUnits#</cfoutput> is already entered.  Record Not Inserted!!!.
    </cfcatch>
    </cftry>
    <cfquery name="insertAssemblyDelay" datasource="#REQUEST.datasource#">
    INSERT INTO tbl_Assembly_Delay(ID, Code, DelayTime)
    SELECT ID , '#Trim(FORM.Code)#', '#Trim(FORM.DelayTime)#'
    FROM tbl_Assembly_Production
    WHERE tbl_Assembly_Production.WorkOrder = '#FORM.WorkOrder#'
    </cfquery>
    <cftry>
    <cfset list1 = #FORM.Unit# >
    <cfset list2 = #FORM.WorkOrder#>
    <cfset list3 = #FORM.YearAssy#>
    <cfloop list="#list1#" index="j">
    <cfloop list="#list2#" index="k">
    <cfloop list="#list3#" index="m">
    <cfquery name="insertunits" datasource="#REQUEST.datasource#">
    IF NOT EXISTS
    select ID, Workorder, Unit
    from tbl_Assembly_Unit
    where Workorder = '#k#' and Unit = '#m#'
    BEGIN
    Insert into tbl_assembly_Unit(ID, YearAssy, WorkOrder, Unit)
    SELECT ID, '#Trim(FORM.YearAssy)#', '#Trim(k)#', '#Trim(j)#'
    FROM tbl_Assembly_Production
    WHERE tbl_Assembly_Production.Workorder = '#FORM.WorkOrder#'
    END
    </cfquery>
    </cfloop>
    </cfloop>
    </cfloop>
    Your Unit(s) have been added.
    <cfcatch type="database">
    The Unit(s) you listed cannot be more than once.
    </cfcatch>
    </cftry>
    </cftransaction>

    It's probably simpler than you think.  For the sake of this demo, I'll assume your 3 lists have the same number of elements.  You can simply do this.
    <cfloop from = "1" to = ListLen(List1), index = "ii">
    insert into your table (field1, field2, field3)
    values
    (ListGetAt(List1, ii)
    , ListGetAt(List1, ii)
    , ListGetAt(List1, ii) )
    closing tags, proper syntax, etc.

  • How to handle Coldfusion SOAP Web Service Errors

    Hi,
    I have just created simple wsdl example:
    My Component:
    <cfcomponent displayname="mytest">
        <cffunction name="service_login_authentication" access="remote" output="true" returntype="any" hint="Returns login">
         <cfargument name="login" type="string" required="yes">
            <cfargument name="password" type="string" required="yes">
              <cfif #arguments.login# eq "abcdef" and #arguments.password# eq "123456">
                      <cfxml variable="soapRes">                
                            <kps_response>
                                <message>OK</message>
                                <token>354dfdffsdf</token>
                             </kps_response>
                        </cfxml>
                 <cfelse>
                         <cfthrow type="MyException" message="INVALID LOGIN" errorcode="1000" />
             </cfif>        
          <cfreturn soapRes >
        </cffunction>
    </cfcomponent>
    Its generating wsdl and no problem with response but when generating any error like username and password does not match then it's generating fault code like this:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
          <soapenv:Fault>
             <faultcode>soapenv:Server.userException</faultcode>
             <faultstring>coldfusion.xml.rpc.CFCInvocationException: [coldfusion.runtime.CustomException : INVALID LOGIN. ]</faultstring>
             <detail>
                <ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">HOST_NAME</ns1:hostname>
             </detail>
          </soapenv:Fault>
       </soapenv:Body>
    </soapenv:Envelope>
    But I want customize Fault Code like this:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
          <soapenv:Fault>
             <faultcode>1000</faultcode>
             <faultstring>INVALID LOGIN</faultstring>
          </soapenv:Fault>
       </soapenv:Body>
    </soapenv:Envelope>
    Fault Code and Fault String should be customize and I don't want detail tag completely. In old ColdFusion version like ColdFusion 8 displaying detail tag with <ns1:stackTrace xmlns:ns1="http://xml.apache.org/axis/"> coldfusion.xml.rpc.CFCInvocationException: and so on.
    Any suggestions on how to create customize faultcode and faultstring is very helpful.
    Thanks!!

    But my component is not produces this fault code:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">                   
                                <soapenv:Body>                   
                                      <soapenv:Fault>                   
                                         <<faultcode>1000</faultcode>                   
                                                   <faultstring>INVALID LOGIN</faultstring>                   
                                      </soapenv:Fault>                   
                                   </soapenv:Body>                   
    </soapenv:Envelope>
    What is your ColdFusion Version as i have checked in ColdFusion 11 developer edition and ColdFusion 8 enterprise which is on window 2003 server.
    Could you please check my below component, did i am doing something wrong.
    <cfcomponent output="false">
        <cffunction name="service_login_authentication" access="remote" output="true" returntype="any" hint="Returns login">
         <cfargument name="login" type="string" required="yes">
            <cfargument name="password" type="string" required="yes">
      <cfset var isLoginValid = False>
            <cftry>
              <cfif #arguments.login# eq "1111" and #arguments.password# eq "1111">
                  <cfset isLoginValid = True>
                </cfif>
                 <cfif isLoginValid>
                        <cfsavecontent variable="soapRes"><?xml version="1.0" encoding="UTF-8"?>           
                           <kps_response>           
                               <message>OK</message>           
                               <token>354dfdffsdf</token>           
                            </kps_response>           
                         </cfsavecontent>           
                    <cfelse>           
                        <cfthrow type="MyException" message="INVALID LOGIN" errorcode="1000" />           
                    </cfif>
                      <cfcatch type="MyException">           
                         <cfsavecontent variable="soapRes">               
                                <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">                   
                                <soapenv:Body>                   
                                      <soapenv:Fault>                   
                                         <<cfoutput><faultcode>#cfcatch.errorCode#</faultcode>                   
                                                   <faultstring>#cfcatch.message#</faultstring></cfoutput>                   
                                      </soapenv:Fault>                   
                                   </soapenv:Body>                   
                                </soapenv:Envelope>                  
                           </cfsavecontent>
                    </cfcatch>
                </cftry>     
          <cfreturn soapRes >
        </cffunction>
    </cfcomponent>
    If my component is okay then may be possible some setting in ColdFusion administrator. i have checked in SoapUI as well via getSoapResponse method.

  • Creating a cfhttp multi part form post for google docs upload

    Hey all,
    If you saw my last thread, you know I am working with google docs and uploading documents to it. Well I got basic document uploading working, but now I am trying to include meta data. Google requires you to include the metadata with the actual file data and seperate them by using a multi part form upload. I don't know exactly the process for doing so, but they have a handy code snippet of the desired results at
    http://code.google.com/apis/documents/docs/3.0/developers_guide_protocol.html#UploadingDoc s
    So I am basically trying to mimic that payload, however I am continually getting an error stating that there are no parts in a multi part form upload.
    <errors xmlns='http://schemas.google.com/g/2005'><error><domain>GData</domain><code>InvalidEntryException</code><internalReason>No parts detected in multipart message</internalReason></error></errors>
    to be exact. I am not really sure what I am doing wrong here. I figure it is one of two things, either I am not including the actual data in the payload properly (I am currently using a body type param for the payload, but I have also tried a formfield named content to deliver it. Neither worked). So maybe I need to do something else tricky there? The other thing which I am not reallly sure about is the content-length attribute. I don't know exactly how to calculate that, and I read in another forum that a content length attribute was messing that guy up. Right now I am just taking the lenght of the payload string and multiplying by 8 (to get the number of bytes for the entire payload) but hell if I know if that is right. It could be I just don't know how to set up the parts for the message, it seems pretty straight forward though. Just define a boundary in the content-type, then put two dashes before it wherever you define a new part, and two dashes trailing the last part.
    Anyway, here is my code, any help is much appreciate. I'm a bit beyond my expertise here (not really used to trying to have to roll my own http requests, nevermind multipart post form data) so I'm kinda flailing around. Thanks again.
    <cffunction name="upload" access="public" returnType="any" hint="I upload the document." output="false">
        <cfargument name="filePath" type="string" required="false" hint="file to upload.">
        <cfargument name="docType" type="string" required="yes" hint="The document type to identify this document see google list api supported documents">
        <cfargument name="parentCollectionId" type="string" required="no" hint="the name of the collection/collection to create (include collection%3A)">
        <cfargument name="metaData" type="struct" required="no" hint="structure containing meta data. Keyname is attribute name, value is the value">
        <cfset var result = structnew()>
        <cfset result.success = true>
        <cftry>
            <cfif structkeyexists(arguments,"parentCollectionId")>
                      <cfset arguments.parentCollectionId = urlencodedformat(parentCollectionId)>             
                      <cfset result.theUrl = "https://docs.google.com/feeds/default/private/full/#arguments.parentCollectionId#/contents">
                <cfelse>
                        <cfset result.theUrl = "https://docs.google.com/feeds/default/private/full/">
            </cfif>
             <cfoutput>
                  <cffile action="read" file="#arguments.filePath#" variable="theFile">
                <cfsavecontent variable="atomXML">
                     Content-Type: application/atom+xml
                    <?xml version='1.0' encoding='UTF-8'?>
                    <entry xmlns="http://www.w3.org/2005/Atom" xmlns:docs="http://schemas.google.com/docs/2007">
                      <category scheme="http://schemas.google.com/g/2005##kind"
                          term="http://schemas.google.com/docs/2007###arguments.docType#"/>
                        <cfloop collection="#arguments.metaData#" item="key">
                            <#key#>#arguments.metadata[key]#</#key#>
                        </cfloop>
                    </entry>
                    --END_OF_PART
                    Content-Type: text/plain
                    #theFile#
                    --END_OF_PART--
                </cfsavecontent>       
            </cfoutput>      
            <cfset result.postData = atomXML>
            <cfhttp url="#result.theUrl#" method="post" result="httpRequest" charset="utf-8" multipart="yes">
                <cfhttpparam type="header" name="Authorization" value="GoogleLogin auth=#getAuth()#">
                <cfhttpparam type="header" name="GData-Version" value="3">
                <cfhttpparam type="header" name="Content-Length" value="#len(trim(atomXML))*8#">           
                <cfhttpparam type="header" name="Content-Type" value="multipart/related; boundary=END_OF_PART">
                <cfhttpparam type="header" name="Slug" value="test file --END_OF_PART">
                <cfhttpparam type="body" name="content" value="#trim(atomXML)#">
            </cfhttp>
            <cftry>
                   <cfset packet = xmlParse(httpRequest.fileContent)>
                <cfif httpRequest.statusCode neq "201 created">
                    <cfthrow message="HTTP Error" detail="#httpRequest.fileContent#" type="HTTP CODE #httpRequest.statusCode#">
                </cfif>
                <cfset result.data.resourceId = packet.entry['gd:resourceId'].xmlText>
                <cfset result.data.feedLink = packet.entry['gd:feedLink'].xmlText>
                <cfset result.data.title = packet.entry.title.xmlText>  
                <cfset result.data.link = packet.entry.title.xmlText>    
                <cfcatch>
                     <cfset result.data = httpRequest>
                </cfcatch>
            </cftry>       
            <cfcatch type="any">
                 <cfset result.error = cfcatch>
                <cfset result.success = false>
            </cfcatch>
        </cftry>   
        <cfreturn result>
    </cffunction>
    Also, this is what my atomXML data ended up looking like when it got sent to google. This isn't the WHOLE request (it doesn't include the headers, just the body).
    Content-Type: application/atom+xml
    <?xml version='1.0' encoding='UTF-8'?>
    <entry xmlns="http://www.w3.org/2005/Atom" xmlns:docs="http://schemas.google.com/docs/2007">
    <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/docs/2007#document"/>
    <TITLE>Woot Test</TITLE> </entry>
    --END_OF_PART
    Content-Type: text/plain
    I'm a test document lol!
    --END_OF_PART--

    Woot, I got it. I had to send the gData version number, and change the URL.
    Here is the working function.
    <cffunction name="upload" access="public" returnType="any" hint="I upload the document." output="false">
        <cfargument name="myFile" type="string" required="false" hint="file to upload.">
        <cfset var result = "">
        <cfset theUrl = "https://docs.google.com/feeds/default/private/full">
        <cffile action="read" file="C:\website\xerointeractive\testing\test.txt" variable="theFile">
        <cfset fileSize = createObject("java","java.io.File").init("C:\website\xerointeractive\testing\test.txt").length()>
        <cfhttp url="#theURL#" method="post" result="result" charset="utf-8" >
            <cfhttpparam type="header" name="Authorization" value="GoogleLogin auth=#getAuth()#">
            <cfhttpparam type="header" name="Content-Type" value="text/plain">
            <cfhttpparam type="header" name="Slug" value="test file">
            <cfhttpparam type="header" name="GData-Version" value="3">
            <cfhttpparam type="header" name="Content-Length" value="#fileSize#">
            <cfhttpparam type="body" value="#theFile#">
        </cfhttp>
        <cfreturn result>
    </cffunction>

  • Value from CFC using cfscript

    I've got a function in a CFC that inserts a parent value into
    an Oracle table (see below). I want to extend the function to
    return the new parent ID so that I can use it to insert the child
    values. I'm using <cfscript> to execute the function which
    works fine with the data insert, but I can't quite work out how to
    output the new parent ID value in <cfscript>. Any help
    appreciated.
    Thanks in advance
    Roy.
    <cffunction name="insertApp" hint="Insert Applications"
    returntype="query">
    <cftry>
    <!--- Insert Values --->
    <cfquery name="qryAppInsert" username='#this.uid#'
    password='#this.pwd#' datasource='#this.source#'>
    INSERT INTO
    impsapp.tblAPPLICATIONS
    VALUES
    (#this.ID#, '#this.dType#',
    TO_DATE('#this.cDate#','dd-mon-yyyy'))
    </cfquery>
    <!--- Select current Value form DUAL --->
    <cfquery name="qryNewSeq" username='#this.uid#'
    password='#this.pwd#' datasource='#this.source#'>
    SELECT impsapp.Test_SEQ.currval x FROM dual
    </cfquery>
    <cfcatch type="any">
    <cfreturn "Error in Function insertApp">
    </cfcatch>
    </cftry>
    <!--- Return Query --->
    <cfreturn qryNewSeq>
    </cffunction>
    <cfscript>
    // create componet object
    comTest = createObject("component", "cfc.Test");
    // Set the properties from Form
    comTest.uid = '#myUser#';
    comTest.pwd = '#myPasswd#';
    comTest.source = '#myDS#';
    comTest.holder= #Form.eID#;
    comTest.appType = '#Form.pType#';
    comTest.recDate = '#DateFormat("#Form.dateReq#",
    "dd/mmm/yyyy")#';
    //Call insert finction
    apply_Card.insertApplications();
    //I need to be able to output and use the value x from the
    qryNewSeq above
    </cfscript>

    YourQuery = comTest.insertApp();
    Your function might be too complicated. If this.id is the
    same as test_seq.currval, why bother with the second query?

  • AD and adding group members via CFLDAP

    I posted this over in Advanced techniques with only one
    brave, yet
    unfortunately uninformed taker...
    Anyone here have a clue as to why I'd get the error described
    in the
    text below???
    [Only Response...]
    Thank you for your response... I probably should explain
    better what
    this code does...
    It queries a data source (DB2 database) for a list of about
    2000 names
    (specifically their Employee number).
    Then it queries the MS Active directory for a list of anyone
    who has an
    attribute of employeeNumber that
    is not an empty string.
    Next, it uses a QofQ to join the two record sets together,
    tossing out
    any records that do not match from
    both of the data sources.
    Then I loop over that list of employees adding them into a
    group.
    This operation dos nothing to modify a users password.
    Thanks,
    D.
    Ian Skinner wrote:
    > This came off of another CF related list. Not sure if it
    applies to
    > your situation or not.
    >
    > * You cannot change passwords unless you have a SSL cert
    setup for the
    > CF server and the AD domain controller.
    >
    > I have not first hand experience with this, so all I can
    offer is to
    > pass along the above comment.
    >
    > dnagel wrote:
    >> So, this is the advanced techniques group... and no
    one feels the
    >> least bit challenged?
    >> Theres got to be someone who enjoys delving into
    LDAP out there...
    >>
    >> D.
    I'm having a bit of trouble getting the CFLDAP Modify query
    to execute
    after
    I tied it into the CFLOOPed query... When I ran it with my
    own users DN it
    worked great... it does not work with any other DN. My
    account has Domain
    Adminis on this sandboxed server and is capable of making the
    change by hand
    using the AD tools inside of MMC... Any suggestions? Thanks,
    D.
    <cfset servername = "AD.TESTSITE.com">
    <cfset username = "[email protected]">
    <cfset password = "PASSWORD">
    <cfset domain = "TESTSITE">
    <cfset OU = "ou=Granite">
    <cfoutput>
    <CFSet GroupName="TestDistribution">
    <CFSet GroupDN =
    "cn=#GroupName#,cn=Users,dc=#domain#,dc=com">
    <CFQuery name="Users" datasource="GCI_Workforce">
    Select cast (WBAN8 as varchar(10)) as WBAN8, wbemal from
    WTWDSECPJ1 where WBEXEMPT ='Y'
    </CFQuery>
    <cfldap
    action="query"
    server = "#servername#"
    username = "#username#"
    password = "#password#"
    start = "#OU#,dc=#domain#,dc=com"
    attributes = "dn,employeeNumber"
    filter = "employeeNumber=*"
    name = "adDNLookup"
    scope = "subtree"
    >
    <CFQuery Name="JoinUsers" DBType="Query">
    Select
    adDNLookup.DN, adDNLookup.employeeNumber
    from
    adDNLookup,
    Users
    Where
    adDNLookup.employeeNumber = Users.wban8
    </CFQuery>
    <CFLoop Query="JoinUsers">
    <CFTry>
    <!---<CFSet UserDN = "member=cn=Dennis
    Nagel,CN=Users,DC=TESTSITE,DC=com">--->
    <CFSet UserDN = "member=#DN#">
    <CFSet UserName="#employeeNumber#">
    #UserName# #UserDN#<br>
    <cfldap
    action="modify"
    server = "#servername#"
    username = "#username#"
    password = "#password#"
    modifytype="add"
    attributes = "#UserDN#"
    dn="#GroupDN#"
    separator=";"
    >
    <cfoutput>#UserName# has been added to the group
    (#GroupName#).</cfoutput>
    <cfcatch type="any">
    <cfif FindNoCase( "ENTRY_EXISTS", cfcatch.message )>
    <cfoutput>
    #UserName# is already assigned to the group
    (#GroupName#).
    </cfoutput>
    <cfelse>
    <cfoutput>
    Unknown error : #cfcatch.detail#")
    </cfoutput>
    <cfabort>
    </cfif>
    </cfcatch>
    </CFTry>
    </CFLoop>
    </cfoutput>
    heres the trace info...
    110028 member=CN=Mary Chalfa, OU=PSP_Indio, OU=PSP,
    OU=GC_Branches,
    ou=Granite, dc=TESTSITE, dc=com
    Unknown error : One or more of the required attributes may be
    missing/incorrect or you do not have permissions to execute
    this
    operation on the server")
    Debugging Information ColdFusion Server Enterprise
    6,1,0,63958
    Template /JDE-AD-Sync/JDE-AD-Groups.cfm
    Time Stamp 22-Jun-06 12:02 PM
    Locale English (US)
    User Agent Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2;
    SV1; .NET
    CLR 1.1.4322; .NET CLR 1.0.3705)
    Remote IP 127.0.0.1
    Host Name 127.0.0.1
    Execution Time
    Total Time Avg Time Count Template
    687 ms 687 ms 1
    C:\Inetpub\wwwroot\JDE-AD-Sync\JDE-AD-Groups.cfm
    0 ms 0 ms 1 C:\Inetpub\wwwroot\JDE-AD-Sync\Application.cfm
    0 ms STARTUP, PARSING, COMPILING, LOADING, & SHUTDOWN
    687 ms TOTAL EXECUTION TIME
    red = over 250 ms average execution time
    Exceptions
    12:02:45.045 - Application Exception - in
    C:\Inetpub\wwwroot\JDE-AD-Sync\JDE-AD-Groups.cfm : line 67
    An error has occured while trying to execute modify :[LDAP:
    error code 49 - 80090308: LdapErr: DSID-0C090334, comment:
    AcceptSecurityContext error, data 525, vece].
    SQL Queries
    Users (Datasource=GCI_Workforce, Time=47ms, Records=2203) in
    C:\Inetpub\wwwroot\JDE-AD-Sync\JDE-AD-Groups.cfm @
    12:02:44.044
    Select cast (WBAN8 as varchar(10)) as WBAN8, wbemal from
    WTWDSECPJ1 where WBEXEMPT ='Y'
    JoinUsers (Datasource=, Time=16ms, Records=996) in
    C:\Inetpub\wwwroot\JDE-AD-Sync\JDE-AD-Groups.cfm @
    12:02:45.045
    Select
    adDNLookup.DN, adDNLookup.employeeNumber
    from
    adDNLookup,
    Users
    Where
    adDNLookup.employeeNumber = Users.wban8
    Scope Variables
    Application Variables:
    applicationname=JDE-AD-Sync
    ds=GCI_WFD
    Cookie Variables:
    JSESSIONID=36301107041151000811062
    Server Variables:
    COLDFUSION=Struct (8)
    OS=Struct (5)
    Session Variables:
    cfid=831
    cftoken=54562187
    sessionid=JDE-AD-SYNC_831_54562187
    urltoken=CFID=831&CFTOKEN=54562187
    Debug Rendering Time: 63 ms

    ok, I found it... re-use of the vaiable username... : -)
    Damn ambiguous error messages.
    Thanks to Ian for taking a look.
    D.

  • Creating a COM object with CF9 32-bit on Windows Server 2008 R2 64-bit machine

    I'm using a 32-bit version of CF9 and it's installed on a Windows Server 2008 R2 machine (64-bit).  The problem I'm running into is that it won't allow me to create a COM object - it gives me the error, "no ntvinv in java.library.path null" when I try to run,
    <cftry>
    <cfobject type="COM" action="CONNECT" name="Engine" class="JRO.JetEngine">
    <cfcatch type="Any">
        <cfobject type="COM" action="CREATE" name="Engine" class="JRO.JetEngine">
    </cfcatch>
    </cftry>
    Then when I run it a 2nd time, I get "An exception occurred when instantiating a COM object. The cause of this exception was that: java.lang.RuntimeException: Can not use native code: Initialisation failed."
    Can you help me?

    Replying for your patchset installation pre-req error:
    Use below command:
    ./runInstaller -ignoreSysPrereqs
    Review MOS note 763143.1 for more info.

Maybe you are looking for