Ask a Question related to Coldfusion Database Access, Design and Development.
-
mjwjal #1
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
-
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... -
using cftransaction with queries
Hi, If cfquery fails, how can cftransaction recognise this? If a query fails I need to roll it back. Thanks -
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... -
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... -
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... -
surenr #2
Re: cftransaction
Upto what I have realised CF creates a new connection for each query unless it is cached.
surenr Guest
-
guccio1 #3
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
-
Ian Skinner #4
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
-
paross1 #5
Re: CFTRANSACTION
You may want to post your code so that others may have the opportunity to possibly spot the problem.
Phil
paross1 Guest
-
guccio1 #6
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%"> </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%"> </td>
</tr>
</table>
<cfabort>
</cfcatch>
</cftry>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" width="90%">
<TR>
<td width="10%"> </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%"> </td>
</tr>
<tr>
<td width="10%"> </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%"> </td>
</tr>
<tr>
<td width="10%"> </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>
<br>
<FONT SIZE="3" FACE="helvetica" color="Navy"><b>Attempt
#GetQuestion.attempts# Of 3!</b></font>
<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> </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%"> </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
-
Ian Skinner #7
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
-
paross1 #8
Re: CFTRANSACTION
Interesting, since your code sample does not contain any CFTRANSACTION tags......
Phil
paross1 Guest
-
Dan Bracuk #9
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
-
Jochem van Dieten **AdobeCommunityExpert** #10
Re: CFTRANSACTION
guccio1 wrote:
What is in put_header.cfm? And in your application.cfm/cfc?>
> <cfinclude template="put_header.cfm">
Does this datasource validate from the CF Admin?> <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>
What is in your database log file?> "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.
Jochem
--
Jochem van Dieten
Adobe Community Expert for ColdFusion
Jochem van Dieten **AdobeCommunityExpert** Guest
-
guccio1 #11
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



Reply With Quote

