Bernard, it is not a bug: in MySQL the LOCK TABLES command commits the current transaction. It is in the manual :). The reason is that in MyISAM a transaction is simulated by LOCK TABLES where you lock all the involved tables at once to avoid deadlocks. With InnoDB use of LOCK TABLES is normally not needed because of automatic row level locking. Regards, Heikki http://www.innodb.com At 12:49 PM 9/14/01 +0200, you wrote: >Heikki Tuuri wrote: >> >> Bernard, >> >> you could look at the source code of >> the mysql client. I think it is written >> in C or C++, and should show how you get >> the C API working. >> >> Unfortunately there is no global command >> to set all sessions to autocommit = 0. >> There has been discussion of adding such >> an option. >> >> Regards, >> >> Heikki >> http://www.innodb.com > > >Hello, > >Sorry for disturbing you, but I have found >my 'mistake' about innobase and autocommit mode >(set autocommit=0); > >I fact, I getted a wrong result, >(I mean autocommit = 0 not taken in account), >because of the use of lock/unlock instructions. > > >So,I have made a new test whith 2 interactive MySql sessions >and it seems that lock/unlock instructions >INVALIDATE the set autocommit=0. >which leeds to a wrong result, in case of rollback ! > >Example : > session 1 session 2 > ------------------------------------ > set autocommit=0 > lock table... > insert into .... > unlock > select ..// here I get the NEW insertion > // (instead of the LACK of commit) > >I known, that innobase does lock at row level, >but I thought that I was allowed to but a >lock a table level !, and use commit/rollback >but it seems that no. > > >Furthermore, breaking the session 1 connection prior >to unlock sets the transaction in table. >We tried with lock either in read or write mode. > >I know that global lock table is not mandatory on InnoDB tables, >but the way we used locks leads us to inconsistences. >Did I find a bug, or should >I read the fine manual more carrefully ? ;o) > >Sincerely. > >Remember : > I use MySql version 3.23.39 under Linux (x86) > > > > > > >------------- >Bernard CHAMBON >IN2P3 / CNRS (Centre de Calcul de LYON) >Tél : 04 72 69 42 18 >http://www.in2p3.fr/CC > --------------------------------------------------------------------- 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