Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
cftransaction rollback problem
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
whatchamakeofit  
View profile  
 More options Jul 21, 2:50 pm
Newsgroups: macromedia.coldfusion.cfml_general_discussion
From: whatchamakeofit <brendan.w...@gmail.com>
Date: Tue, 21 Jul 2009 11:50:31 -0700 (PDT)
Local: Tues, Jul 21 2009 2:50 pm
Subject: cftransaction rollback problem
Hi.  I'm trying to do a DB transaction, and I'm having trouble trying
to do an explicit rollback.  If I, for example, misspelled
LAST_INSERT_ID, the cfcatch will catch the error, but the
<cftransaction action="rollback" /> won't perform a rollback of the
first query "insert1."  I'm running CF 6 and MySQL.  Here's my code:

<cftry>
        <cftransaction>
                <cfquery name="insert1" datasource="test">
                        insert into bmw1 (fname) values ('#form.fname#')
                </cfquery>
                <cfquery name="getid" datasource="test">
                        select LAST_INSERT_ID() as newid
                </cfquery>
                <cfset newid = getid.newid>
                <cfquery name="insert2" datasource="test">
                        insert into bmw2 (lname, bmw1_id) values ('#form.lname#', #newid#)
                </cfquery>
                <cfquery name="insert3" datasource="test">
                        insert into bmw2 (mname, bmw1_id) values ('#form.mname#', #newid#)
                </cfquery>
        </cftransaction>
        <cfcatch type="database">
                bad transcation
                <cftransaction action = "rollback"/>
        </cfcatch>
</cftry>

Please advise.  Thanks!


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nick Voss  
View profile  
 More options Jul 22, 9:01 am
Newsgroups: macromedia.coldfusion.cfml_general_discussion
From: Nick Voss <ncv...@gmail.com>
Date: Wed, 22 Jul 2009 06:01:04 -0700 (PDT)
Local: Wed, Jul 22 2009 9:01 am
Subject: Re: cftransaction rollback problem
On Jul 21, 1:50 pm, whatchamakeofit <brendan.w...@gmail.com> wrote:

I think you need your transaction code outside your try/catch.
Otherwise your original transaction is completing and then the catch
is firing and its told to rollback a transaction, but there no longer
is one because it's complete.

Nick


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
whatchamakeofit  
View profile  
 More options Jul 24, 2:15 pm
Newsgroups: macromedia.coldfusion.cfml_general_discussion
From: whatchamakeofit <brendan.w...@gmail.com>
Date: Fri, 24 Jul 2009 11:15:00 -0700 (PDT)
Subject: Re: cftransaction rollback problem
found out the error was because the mysql engine i was using was
myisam which doesn't support transactional processing.  i had to
convert my mysql table to Innodb.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google