On Wednesday 21 August 2002 10:40 am, Egor Egorov wrote:

Well, loosely...

SET AUTOCOMMIT=0

does not START a transaction, what it does is signal the database that from 
now on transactions will be explicit, not implicit. That means you NEED to 
have a transaction to get anything to stick in the database, any work done 
while autocommit is 0 that is not part of an explicit transaction is just not 
going to get stored in the database AT ALL. 

In other words when autocommit is 1 it is as if every statement is surrounded 
by a seperate transaction. When autocommit is 0 you must use transactions 
explicitly, THEY ARE NOT OPTIONAL!!! So really the 2 things are not very 
equivalent, in fact to do a transaction you would say

SET AUTOCOMMIT=0
BEGIN WORK
....
COMMIT (or ROLLBACK)

Note however that MySQL will 'toggle' out of autocommit mode if you initiate 
an explicit transaction, so in fact you can simply BEGIN WORK when you are at 
autocommit =1 and things will be fine. Once you COMMIT the database will go 
back to the standard autocommiting behaviour on its own.


> Randy,
> Tuesday, August 20, 2002, 7:49:09 PM, you wrote:
>
> RJ>  in a innodb table type using mysql max
>
> RJ>  is a begin statement the same as set autocommitt = 0??
>
> Yes.

---------------------------------------------------------------------
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

Reply via email to