tracker issue : CF-4205269

select a category, or use search below
(searches all categories and all time range)
Title:

CFTransaction exceptions thrown when CFTransaction not used

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/Duplicate

Reporter/Name(from Bugbase): Tim P. / ()

Created: 09/27/2019

Components: Database, CFQuery

Versions: 2016,2018

Failure Type: Usability Issue

Found In Build/Fixed In Build: CF 2018 updater 5 /

Priority/Frequency: Normal / Most users will encounter

Locale/System: English / Platforms All

Vote Count: 3

Problem Description:
After installing updater 5, we started seeing this error:

java.sql.SQLException: Datasource names for all the database tags within the cftransaction tag must be the same.

This error is being reported for simple 'select' queries in mature code that does not use CFTransaction

Steps to Reproduce:
(we don't have a smoking gun, but the general steps follow)
1) update table A in datasource A (use CFQuery without CFTransaction)
...
2) select something from table B in datasource B (use CFQuery without CFTransaction)
>>> CFTransaction error occurs

It's probably not this simple, and it doesn't happen every time.  Step 1 may not need to be in the same request as step 2.

Actual Result:

   0: ........coldfusion.tagext.sql.TransactionTag.verifyDataSrc[transactiontag.java:383]
   1: ........coldfusion.tagext.sql.QueryTag.validate[querytag.java:629]
   2: ........coldfusion.tagext.sql.QueryTag.doValidate[querytag.java:775]
   3: ........coldfusion.tagext.sql.QueryTag.doAfterBody[querytag.java:758]
   4: CFM....(our CF code - simple SELECT query)
- this particular method runs a simple 'select' query to verify that a given userID exists in the 'users' table (in the 'users' datasource) - no CFTransaction
- we have seen this with several different queries, all result in the same exception

In this scenario, a simple 'update' query has run using our 'site' datasource in the same request (again, with no CFTransaction).  This error does not happen every time the request is made, but occurrences appear to be clustered (i.e. it may happen 2-3 times over a 5 minute period, but 15 minutes later it won't happen at all)

At this point we don't have any concrete steps to reproduce, but my suspicion is that there's some corruption with the connection pool.  This suspicion comes from the issue going away (for a while, at least) if the service is restarted or the server is left idle for a while.

Expected Result:
no error

Any Workarounds:
revert to updater 4

Attachments:

Comments:

We also see this issue across some of some of our sites. Reverting to HF 4 fixes the issue. No obvious way to reproduce but the issue only started when we updated and we dont use cftransaction.
Comment by Toby W.
31421 | September 27, 2019 08:06:29 AM GMT
Hi Toby & Tim, I am unable to repro this issue with MSSQL database server. I have used the code snippet mentioned below: {code:java} <cfquery datasource="sqlserver2012_merant" result="q1"> Update employees set Department = 'Accounting' where Employee_Id = 1 </cfquery> <cfdump var="#q1#"> <cfquery datasource="sqlserver2012_pubs" name="q2"> select * from publishers </cfquery> <cfdump var="#q2#"> {code} I have tried executing it using JMeter and send almost 100K requests but unable to repro. I would really appreciate if you can provide some more details so that we can fix this issue.   -Nimit
Comment by Nimit S.
31422 | September 27, 2019 08:25:34 AM GMT
Tim, are you using cftransaction anywhere at all? We found that we are using it but a long way from where the error occurs. Looking at the tagContext of all the cfm / cfc requests, the error occurs inside a function that is called from original cfm. This cfm uses cftransaction around a single query. It is as if the tag is not registering as being closed and contains all the queries after but this issue doesnt happen on all the sites which use the same code.
Comment by Toby W.
31423 | September 27, 2019 09:25:22 AM GMT
Hi Nimit, I have attached a reproduction of the issue. Simply running a query within cftransaction then calling a function inside another component with separate DSNs will cause the following error: java.sql.SQLException: Datasource names for all the database tags within the cftransaction tag must be the same.
Comment by Toby W.
31424 | September 27, 2019 09:38:20 AM GMT
Hi Toby, Thanks for providing the isolated repro case. I will look into this and update this bug with the latest information. -Nimit
Comment by Nimit S.
31425 | September 27, 2019 09:51:12 AM GMT
Toby... Hopefully with your repro case... they'll be able to fix the problem quickly. We do use CFTransaction in some cases, but in the cases where we've seen this problem, CFTransaction is not in play. I suspect that the CFTransaction in your example is not required to trigger the problem
Comment by Tim P.
31430 | September 27, 2019 03:06:23 PM GMT
Hi All, This issue is fixed now. Please reach out to ColdFusion support @ [cfinstal@adobe.com|mailto:cfinstal@adobe.com] to get the patch. -Nimit
Comment by Nimit S.
31456 | September 29, 2019 05:38:07 PM GMT
We are seeing an issue that looks to be this same problem. Once the data sources are corrupted pages all over the site start to fail.
Comment by Colby A.
31550 | October 04, 2019 03:36:37 PM GMT
Updater 5 is unusable until this is fixed
Vote by Colby A.
31551 | October 04, 2019 03:38:22 PM GMT
@Colby A: Can you please drop a mail to cfinstal@adobe.com to get the appropriate patch that fixes this issue? Please share the configuration details as well so that the correct version patch can be shared for this.
Comment by Ashudeep S.
31561 | October 08, 2019 06:39:06 AM GMT
Hi All, This is a duplicate of another bug #CF-4205250. We are tracking this issue as part of that bug itself. Hence, I am withdrawing this bug as duplicate. -Nimit
Comment by Nimit S.
31593 | October 14, 2019 12:29:52 PM GMT
It does appear that this is fixed in updater 6 - this one is closed as a duplicate, but the given ID doesn't seem to line up
Comment by Tim P.
31892 | November 26, 2019 10:58:09 PM GMT