This is what I think.
When Autocommit is set you DO NOT have to enter COMMIT after you update your
DB (Update, Insert Delete), but you will be changing the DB after every
statement, therefore you cannot change your mind after the command is
execute.
Now as for BEGIN, it will begin a Transaction regardless of the Autocommit
value. Therefore if you have Autocommit set, but you do:
BEGIN;
SQLCOMMANDS;
COMMIT OR ROLLBACK;
The changes will be save only at the COMMIT or if you do not want the
changes to take effect you can ROLLBACK.
When Autocommit is not set you MUST COMMIT after your SQL statement in order
for the changes to be written into the DB regardless as to you start or not
with BEGIN.
HTH
JFernando
*** sql ***
-Original Message-
From: Peter Brawley [mailto:peter.brawley@;artfulsoftware.com]
Sent: October 30, 2002 12:38
To: Dyego Souza do Carmo; Egor Egorov
Cc: [EMAIL PROTECTED]
Subject: Re: Re[2]: Start Transaction in InnoDB
Dyego,
BEGIN, not set begin. My understanding is that BEGIN is a synonym for SET
autocommit=0.
PB
-
> AB>> I would like to know, how can I start a new transaction using InnoDB
Tables?
>
> EE> Use BEGIN statement:
> EE> http://www.mysql.com/doc/en/COMMIT.html
>
> EE> Don't forget to SET AUTOCOMMIT=0;
>
>
> What is the diference of SET AUTOCOMMIT=0;
>
> and set BEGIN; ?
>
> If I start the transaction with "BEGIN" and without "SET AUTOCOMMIT=0"
what will happen ?
>
> what is the diference ?
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php