Ask a Question related to Coldfusion Database Access, Design and Development.
-
CFGumby #1
CFTransaction doesn't rollback on error
Hi all, years ago on CF 4.5, our cftransaction tags used to rollback changed
data when something inbetween <cftransaction> and </cftransaction> failed or
even a <cfabort>. But ever since we upgraded to CFMX, they do not roll back
data. We also went to JDBC at the same time, I don't know if that has anything
to do with it. About the same time, we also changed from MSSQL 7 to MSSQL
2000. And we are currently on CFMX7. Somewhere in all this changing,
cftransaction broke. I'm at a loss. What should we check to get this working
again? Thanks in advance.
CFGumby Guest
-
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... -
SFTP rollback error
I have a really wierd error when publishing with rollbacks via SFTP. I should start by saying that I am using the contribute client on Mac OS X,... -
CFtransaction error
I'm getting the following error: Nested transactions are not supported. A cftransaction tag can not be nested within another cftransaction tag. ... -
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... -
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... -
CF_Oracle #2
Re: CFTransaction doesn't rollback on error
Please present your code. Hope you use somethging like that within cftransaction tags
<cfcatch type="database">
<cftransaction action = "rollback"/>
</cfcatch>
CF_Oracle Guest
-
CF_Oracle #3
Re: CFTransaction doesn't rollback on error
Please present your code. Hope you use somethging like that within cftransaction tags
<cfcatch type="database">
<cftransaction action = "rollback"/>
</cfcatch>
CF_Oracle Guest
-
CFGumby #4
Re: CFTransaction doesn't rollback on error
That was one version. Normally, it was like this;
<cftransaction>
<cfquery...>
</cfquery>
<cfquery...>
</cfquery>
</cftransaction>
That used to work. I've tried that in a test script and also your way;
<cftransaction>
<cftry>
<cfquery...>
</cfquery>
<cfquery...>
</cfquery>
<cfcatch type="any">
<cftransaction action = "rollback"/>
</cfcatch>
</cftry>
</cftransaction>
Niether one works, but they used to.
Thanks.
CFGumby Guest
-
BKBK #5
Re: CFTransaction doesn't rollback on error
<cftransaction>
<cftry>
<cfquery...>
</cfquery>
<cfquery...>
</cfquery>
<cfcatch type="any">
<cftransaction action = "rollback"/>
</cfcatch>
</cftry>
</cftransaction>
Better is
<cftry>
<cftransaction>
<cfquery...>
</cfquery>
<cfquery...>
</cfquery>
<cfcatch type="any">
<cftransaction action = "rollback"/>
</cfcatch>
</cftransaction>
</cftry>
But ever since we upgraded to CFMX, they do not roll back data.
If the queries run without errors, Coldfusion's default behaviour is to
commit. It's therefore not clear to me why you expect the transaction to roll
back. Was there an error?
BKBK Guest
-
CFGumby #6
Re: CFTransaction doesn't rollback on error
Sorry, this is basically a copy of our test cfm. I purposely misspelled a
field name in the second query, forcing it to fail and it does. However, the
update from the first queries still exits in the database. In the second
query, I misspelled UserID (UserIDx).
Here are the two queries. Thanks.
<cfquery name="qUpd" datasource="MSSQLDB" dbtype="query">
UPDATE Access
SET Access = 1
WHERE UserID = 1
</cfquery>
<cfquery name="qUpd2" datasource="MSSQLDB" dbtype="query">
UPDATE Access
SET Access = 2
WHERE UserID = 1
AND UserIDX = 1
</cfquery>
CFGumby Guest
-
CFGumby #7
Re: CFTransaction doesn't rollback on error
I found the problem, it is dbtype="query". This is left over from CF 4.5 and
now (from CF help) "all values of the attribute DBTYPE have been depricated
except for QUERY. They do not work, and might cause an error, in releases
later than ColdFusion 5." Why would MM (or Adobe) depricate something and then
let it cause a problem? Sloppy (or lazy) upgrade mentality if you ask me.
"Seamless upgrade" my asterisk.
CFGumby Guest



Reply With Quote

