Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default cftransaction

    I have a question about CFTRANSACTION. We are currently using CF6.0 with
    various versions of Oracle and SQL Server. In our server settings we do not
    maintain connections for any of our data sources. I am wondering when wrapping
    cftransaction around mulitple queries within a single page, does it use the
    same connection for each query or does is create a new connection for each
    query.

    Just curious.

    mjwjal Guest

  2. Similar Questions and Discussions

    1. Error with cftransaction
      I have a method with a cftransaction and inside the cftransaction calls a method that has a cftransaction, before updating to 6.1 I didnt have any...
    2. using cftransaction with queries
      Hi, If cfquery fails, how can cftransaction recognise this? If a query fails I need to roll it back. Thanks
    3. CFTRANSACTION w/ ROLLBACK
      Here's what I'm trying to do, this worked in CF 5, but bombs with the following error in CFMX 6: The <CFCATCH> tag requires an end tag to nest...
    4. is this possible - cftransaction
      I don't want to get into the whole 'users shouldn't have access to the db' discussion. It's a battle that's been lost. We are looking at...
    5. cftransaction question
      Hi there ! Let's say i have a first query which inserts a new row in a table, then a second query (myquery) trying to get the id of the inserted row...
  3. #2

    Default Re: cftransaction

    Upto what I have realised CF creates a new connection for each query unless it is cached.
    surenr Guest

  4. #3

    Default CFTRANSACTION

    I am receiving the following error "The root cause was that:
    java.sql.SQLException: Datasource names for all the database tags within
    CFTRANSACTION must be the same."

    All datasources are the same and I am not using a CFEXIT or CFABORT in the
    code.

    This code worked for years in version 4.5. The error is sporatically popping
    up after moving over to MX 7.

    Any help would be greatly appreciated.



    guccio1 Guest

  5. #4

    Default Re: CFTRANSACTION

    Some code examples would help. Maybe someway that you are creating the
    DSN's is causing them to become incorrect under the new version.

    guccio1 wrote:
    > I am receiving the following error "The root cause was that:
    > java.sql.SQLException: Datasource names for all the database tags within
    > CFTRANSACTION must be the same."
    >
    > All datasources are the same and I am not using a CFEXIT or CFABORT in the
    > code.
    >
    > This code worked for years in version 4.5. The error is sporatically popping
    > up after moving over to MX 7.
    >
    > Any help would be greatly appreciated.
    >
    >
    >
    Ian Skinner Guest

  6. #5

    Default Re: CFTRANSACTION

    You may want to post your code so that others may have the opportunity to possibly spot the problem.

    Phil
    paross1 Guest

  7. #6

    Default Re: CFTRANSACTION

    Her ya go!

    Thanks!

    Here is the code: - you will notice that there is not even a <CFTRANSACTION>
    tag in the code.


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

    <html>
    <head>
    <title>Ask Question</title>
    </head>

    <body>

    <cfinclude template="put_header.cfm">

    <cfoutput>

    <FORM METHOD="post" ACTION="Generic_Account3.cfm">

    <cfset key = 271202>
    <cftry>
    <cfset client_no = Decrypt(#URL.client_no#,key)>
    <cfcatch type="Any">
    <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" width="90%">

    <TR>
    <td width="10%">&nbsp;</td>
    <TD width="70%"><h2>ACM Web Account</h2><P>
    <p>As a result of an incomplete URL executed in your browser, an error
    has occured. Rather than clicking on the link embedded in the email
    you received from us, please copy and paste the link directly
    into your browser.</p>

    <p>If the URL has wrapped, please ensure that there are no spaces
    when you try executing the link.</p>

    <p>Thank you for your patience.</p>

    <p>For further assistance please contact:
    <a href="mailto:msfadmin@hq.acm.org">msfadmin@hq.acm. org</a></p>
    </td>
    <td width="10%">&nbsp;</td>
    </tr>
    </table>
    <cfabort>
    </cfcatch>
    </cftry>
    <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" width="90%">
    <TR>
    <td width="10%">&nbsp;</td>
    <TD width="70%">

    <!--- special for chapter web accounts --->
    <CFIF (IsDefined("URL.c") OR IsDefined("Form.c"))>
    <h2>ACM Chapter Web Account</h2><P>

    You now have four chances to enter the exact verification code you were
    provided.<BR>

    <CFELSE>
    <h2>ACM Web Account</h2><P>

    <b>Here is the security question that you provided to us in order to
    create your account.</b><p>

    You now have four chances to enter the exact answer you provided.
    </CFIF>

    </td>
    <td width="10%">&nbsp;</td>
    </tr>
    <tr>
    <td width="10%">&nbsp;</td>
    <TD width="70%">

    <CFIF (IsDefined("URL.c") OR IsDefined("Form.c"))>
    <b>Case matters:</b> you need to match upper- and lower-case to your
    original verification code.

    Four wrong answers will require you to contact <A
    HREF="mailto:annualreport@acm.org">annualreport@ac m.org</A> for a new
    verification code.<BR>

    <CFELSE>
    <b>Case matters:</b> you need to match upper- and lower-case to your
    original answer.

    Four wrong answers will force you back to the account creation facility
    where you will have to start over.
    </CFIF>
    </td>
    <td width="10%">&nbsp;</td>
    </tr>

    <tr>
    <td width="10%">&nbsp;</td>
    <TD width="70%">
    <CFQUERY name="GetQuestion" datasource="#db#" dbtype="Oracle80">
    SELECT to_char(tdstamp,'DD-MON-YYYY HH:MI:SS am') created_at,
    question,email,attempts,referring_url
    FROM t1
    WHERE client_no = '#client_no#'
    AND tdstamp = (
    SELECT max(tdstamp)
    FROM t2
    WHERE client_no = '#client_no#')
    </CFQUERY>

    <cfif GetQuestion.Recordcount EQ 0>
    <CFIF (IsDefined("URL.c") OR IsDefined("Form.c"))>
    <CFQUERY name="get_web_account_count" datasource="#db#" dbtype="Oracle80">
    SELECT COUNT(*) AS ca_count FROM t3
    WHERE client_no = '#client_no#'
    </CFQUERY>

    <CFIF get_web_account_count.ca_count GT 0>
    <CFSET this_href = "https://" & SERVER_NAME &
    "/public/chapters/chapterprofile/chapteradmin.cfm">
    <CFLOCATION url="#this_href#">
    <CFELSE>
    <CFLOCATION url="chapters_reset_vc.cfm?client_no=#client_no#">
    </CFIF>

    <CFELSE>
    <cflocation url="create.cfm">
    </CFIF>
    </cfif>

    <CFIF GetQuestion.attempts GT 1>
    &nbsp;<br>
    <FONT SIZE="3" FACE="helvetica" color="Navy"><b>Attempt
    #GetQuestion.attempts# Of 3!</b></font>&nbsp;&nbsp;
    <cfif #GetQuestion.attempts# IS 2>
    You have two more tries!<br>
    <cfelse>
    <FONT SIZE="3" FACE="helvetica">This is your last try.
    <ul type="square">
    <CFIF (IsDefined("URL.c") OR IsDefined("Form.c"))>
    <li>A wrong answer will send you back to the beginning of the process
    for creating a chapter web account.</li>
    <CFELSE>
    <li>A wrong answer will send you back to the beginning of the process
    for creating an account.</li>
    </CFIF>

    <li>You will have to start over.</li>
    </ul>
    </font>
    </cfif>


    <CFIF GetQuestion.attempts EQ 4>

    <CFQUERY name="DeleteTempURL" datasource="#db#" dbtype="Oracle80">
    DELETE FROM temp_account_urls
    WHERE client_no = '#client_no#'
    </CFQUERY>

    <CFIF (IsDefined("URL.c") OR IsDefined("Form.c"))>
    <CFLOCATION url="chapters_reset_vc.cfm?client_no=#client_no#">
    <CFELSE>
    <CFLOCATION url="create.cfm">
    </CFIF>
    </cfif>

    </cfif>
    <p>&nbsp;</p>
    <DL>
    <dt><STRONG><font color="Navy">Question:</font>
    #GetQuestion.question#</STRONG>
    </P>

    <DT><STRONG><font color="Navy">Answer:</font></STRONG>
    <DD><INPUT TYPE="text" NAME="TheAnswer" SIZE="80" VALUE="">
    <P>
    </DL>

    <INPUT TYPE="hidden" NAME="client_no" VALUE="#client_no#">
    <INPUT TYPE="hidden" NAME="Email" VALUE="#GetQuestion.email#">

    <CFIF (IsDefined("URL.c") OR IsDefined("Form.c"))>
    <INPUT TYPE="hidden" NAME="c" VALUE="1">
    </CFIF>

    <input type=submit value="Continue">
    <input type=reset Value="Reset Form">
    </FORM>

    </td>
    <td width="10%">&nbsp;</td>
    </tr>
    </TABLE>


    </cfoutput>

    </body>
    </html>



    This is the error message:

    "Error","jrpp-47","07/05/06","16:53:23","Public Applications","Data source
    slick verification failed.The root cause was that: java.sql.SQLException:
    Datasource names for all the database tags within CFTRANSACTION must be the
    same. The specific sequence of files included or processed is:
    D:\wwwroot\Public\Accounts\AskQuestion.cfm, line: 94 "
    coldfusion.tagext.sql.QueryTag$DataSourceVerificat ionException: Data source
    slick verification failed.
    at coldfusion.tagext.sql.QueryTag.validate(QueryTag.j ava:349)
    at coldfusion.tagext.sql.QueryTag.doStartTag(QueryTag .java:440)
    at
    cfAskQuestion2ecfm1195949409.runPage(D:\wwwroot\Pu blic\Accounts\AskQuestion.cfm:
    94)
    at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java :152)
    at coldfusion.tagext.lang.IncludeTag.doStartTag(Inclu deTag.java:349)
    at coldfusion.filter.CfincludeFilter.invoke(Cfinclude Filter.java:65)
    at coldfusion.filter.ApplicationFilter.invoke(Applica tionFilter.java:210)
    at coldfusion.filter.RequestMonitorFilter.invoke(Requ estMonitorFilter.java:51)
    at coldfusion.filter.PathFilter.invoke(PathFilter.jav a:86)
    at coldfusion.filter.ExceptionFilter.invoke(Exception Filter.java:69)
    at coldfusion.filter.BrowserDebugFilter.invoke(Browse rDebugFilter.java:52)
    at
    coldfusion.filter.ClientScopePersistenceFilter.inv oke(ClientScopePersistenceFilt
    er.java:28)
    at coldfusion.filter.BrowserFilter.invoke(BrowserFilt er.java:38)
    at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilt er.java:38)
    at coldfusion.filter.DatasourceFilter.invoke(Datasour ceFilter.java:22)
    at
    coldfusion.filter.RequestThrottleFilter.invoke(Req uestThrottleFilter.java:115)
    at coldfusion.CfmServlet.service(CfmServlet.java:107)
    at coldfusion.bootstrap.BootstrapServlet.service(Boot strapServlet.java:78)
    at jrun.servlet.ServletInvoker.invoke(ServletInvoker. java:91)
    at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvok erChain.java:42)
    at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequ estDispatcher.java:257)
    at jrun.servlet.ServletEngineService.dispatch(Servlet EngineService.java:541)
    at
    jrun.servlet.jrpp.JRunProxyService.invokeRunnable( JRunProxyService.java:204)
    at
    jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRu nnable(ThreadPool.java:426)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java :66)

    Datasouce definition from config file.


    - <var name="slick">
    - <struct type="coldfusion.server.ConfigMap">
    - <var name="update">
    <boolean value="true" />
    </var>
    - <var name="alter">
    <boolean value="true" />
    </var>
    - <var name="delete">
    <boolean value="true" />
    </var>
    - <var name="disable_clob">
    <boolean value="true" />
    </var>
    - <var name="login_timeout">
    <number>30.0</number>
    </var>
    - <var name="buffer">
    <number>64000.0</number>
    </var>
    - <var name="storedproc">
    <boolean value="true" />
    </var>
    - <var name="password">
    <string>RMDbrMuKADg=</string>
    </var>
    - <var name="insert">
    <boolean value="true" />
    </var>
    - <var name="drop">
    <boolean value="true" />
    </var>
    - <var name="CLASS">
    <string>oracle.jdbc.OracleDriver</string>
    </var>
    - <var name="description">
    <string />
    </var>
    - <var name="create">
    <boolean value="true" />
    </var>
    - <var name="NAME">
    <string>slick</string>
    </var>
    - <var name="DRIVER">
    <string />
    </var>
    - <var name="select">
    <boolean value="true" />
    </var>
    - <var name="url">
    <string>jdbc:oracle:oci:@rac</string>
    </var>
    - <var name="blob_buffer">
    <number>64000.0</number>
    </var>
    - <var name="revoke">
    <boolean value="true" />
    </var>
    - <var name="urlmap">
    - <struct type="coldfusion.server.ConfigMap">
    - <var name="datasource">
    <string />
    </var>
    - <var name="sendStringParametersAsUnicode">
    <string>false</string>
    </var>
    - <var name="pageTimeout">
    <string />
    </var>
    - <var name="MaxPooledStatements">
    <string>1000</string>
    </var>
    - <var name="port">
    <string />
    </var>
    - <var name="TimeStampAsString">
    <string>no</string>
    </var>
    - <var name="systemDatabaseFile">
    <string />
    </var>
    - <var name="defaultpassword">
    <string />
    </var>
    - <var name="_logintimeout">
    <number>30.0</number>
    </var>
    - <var name="informixServer">
    <string />
    </var>
    - <var name="database">
    <string />
    </var>
    - <var name="host">
    <string />
    </var>
    - <var name="UseTrustedConnection">
    <string>false</string>
    </var>
    - <var name="args">
    <string />
    </var>
    -
    guccio1 Guest

  8. #7

    Default Re: CFTRANSACTION

    I'm not an expert as I have never used the DBType parameter in an
    <cfquery ...> tag. But I have a vague memory of it changing or being
    depreciated somewhere along the lines between 4.5 and 7. Check the
    documentation and it should give you an idea if this is an issue for you
    or not.

    guccio1 wrote:
    > Her ya go!
    >
    > Thanks!
    >
    > Here is the code: - you will notice that there is not even a <CFTRANSACTION>
    > tag in the code.
    > ...
    Ian Skinner Guest

  9. #8

    Default Re: CFTRANSACTION

    Interesting, since your code sample does not contain any CFTRANSACTION tags......

    Phil
    paross1 Guest

  10. #9

    Default Re: CFTRANSACTION

    dbtype is alive, well, and the attribute you use for query of queries.

    It still might be guccio1's problem though. I don't actually know.
    Dan Bracuk Guest

  11. #10

    Default Re: CFTRANSACTION

    guccio1 wrote:
    >
    > <cfinclude template="put_header.cfm">
    What is in put_header.cfm? And in your application.cfm/cfc?

    > <CFQUERY name="GetQuestion" datasource="#db#" dbtype="Oracle80">
    > SELECT to_char(tdstamp,'DD-MON-YYYY HH:MI:SS am') created_at,
    > question,email,attempts,referring_url
    > FROM t1
    > WHERE client_no = '#client_no#'
    > AND tdstamp = (
    > SELECT max(tdstamp)
    > FROM t2
    > WHERE client_no = '#client_no#')
    > </CFQUERY>
    Does this datasource validate from the CF Admin?

    > "Error","jrpp-47","07/05/06","16:53:23","Public Applications","Data source
    > slick verification failed.The root cause was that: java.sql.SQLException:
    > Datasource names for all the database tags within CFTRANSACTION must be the
    > same. The specific sequence of files included or processed is:
    > D:\wwwroot\Public\Accounts\AskQuestion.cfm, line: 94 "
    > coldfusion.tagext.sql.QueryTag$DataSourceVerificat ionException: Data source
    > slick verification failed.
    What is in your database log file?

    Jochem


    --
    Jochem van Dieten
    Adobe Community Expert for ColdFusion
    Jochem van Dieten **AdobeCommunityExpert** Guest

  12. #11

    Default Re: CFTRANSACTION

    We have contacted Adobe and they stated that a cfexit in a cftransactions
    anywhere on the server can cause this error. The cfexit causes the server to
    drop its current thread which can effect any number of applications on the
    server and display this incorrect message. The fix is to replace cfexits in
    cftranactions with cfaborts. We are in the process of making these coding
    changes as per their request. Everyone's help was so greatly appreciated.



    guccio1 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139