Javier, ----- Original Message ----- From: "Javier Diaz" <[EMAIL PROTECTED]> To: "'Heikki Tuuri'" <[EMAIL PROTECTED]> Cc: "[EMAIL PROTECTED] (E-mail)" <[EMAIL PROTECTED]> Sent: Tuesday, September 03, 2002 12:32 PM Subject: RE: Inno DB Question
> > Heikki, > > Thanks for your answer. I was yesterday making other tests using dbExpress > components and the only way that I found so far to get the dbExpress > components working on transactions on MySQL is using the method ExcuteDirect > of the TSQLConnection. This is the code : > > TSQLConnection *Conn; > > Conn = SQLConnection1->CloneConnection(); > Conn->Connected=true; > > Conn->ExecuteDirect("BEGIN"); > Conn->ExecuteDirect("INSERT INTO regn_info VALUES('t3','test1')"); > Conn->ExecuteDirect("INSERT INTO regn_info VALUES('t4','test2')"); > Conn->ExecuteDirect("COMMIT"); if the above works, that is good. I actually recommend using explicit SQL commands to commit or rollback a transaction, because they are the most probable to work with old interfaces to MySQL. You also know then best what commands you are actually sending to the MySQL server. I assume you also tested ROLLBACK? Did you test that 2 connections keep locks as expected, i.e., if one user has not committed his insert, then another user has to wait if he issues SELECT ... FOR UPDATE which should read that inserted row? > But I don't know why is impossible to do the same using the normal > TSQLQuery. I already sent the message to the borland newsgroups. > > > Thanks > > Javier Thanks you, Heikki > -----Original Message----- > From: Heikki Tuuri [mailto:[EMAIL PROTECTED]] > Sent: 02 September 2002 20:06 > To: [EMAIL PROTECTED] > Subject: Re: Inno DB Question > > > Javier, > > it may be that the dbExpress interface is still lagging behind MySQL > development. > > If I recall right, people have complained loudly in Borland newsgroups that > dbExpress created a new connection for each SQL query it issues to MySQL. > That makes the use of transactions impossible with it. > > If this has not been fixed in the latest version of dbExpress, it would be > good if you would write to Borland people about this, or to the Borland > newsgroups. > > Regards, > > Heikki > Innobase Oy > > ----- Original Message ----- > From: "Javier Diaz" <[EMAIL PROTECTED]> > Newsgroups: mailing.database.mysql > Sent: Monday, September 02, 2002 3:06 PM > Subject: Inno DB Question > > > > Hi all, > > > > I'm using MySQL 4.0.2 alpha-max with Inno DB and Borland Builder 6.0 to > > connect to MySQL. I'm trying to use the new dbExpress component for > Borland > > to connect to MySQL using the libmysql.dll > > > > I have been making some tests with transactions using the dbExpress > > components and the normal ODBC but I can't get the ROLLBACK function to > > work. > > Here are some examples: > > > > using dbExpress > > > > TSQLConnection Q; > > Q= new TSQLQuery(Application); > > Q->SQLConnection=SQLConnection1; > > > > /* I test with and without BEGIN > > Q->SQL->Clear(); > > Q->SQL->Add("BEGIN"); > > Q->ExecSQL(); > > */ > > > > Q->SQL->Clear(); > > Q->SQL->Add("SET AUTOCOMMIT=0"); > > Q->ExecSQL(); > > > > Q->SQL->Clear(); > > Q->SQL->Add("INSERT INTO regn_info VALUES('t1','test1')"); > > Q->ExecSQL(); > > > > > > Q->SQL->Clear(); > > Q->SQL->Add("INSERT INTO regn_info VALUES('t2','test2')"); > > Q->ExecSQL(); > > > > Q->SQL->Clear(); > > Q->SQL->Add("ROLLBACK"); > > Q->ExecSQL(); > > > > //---------------------------------------------------------- > > Using ODBC > > > > > > TQuery *Q_ODBC; > > Q_ODBC= new TQuery(Application); > > Q_ODBC->DatabaseName="salsadb"; > > > > /* > > Q->SQL->Clear(); > > Q->SQL->Add("BEGIN"); > > Q->ExecSQL(); > > */ > > > > Q_ODBC->SQL->Clear(); > > Q_ODBC->SQL->Add("SET AUTOCOMMIT=0"); > > Q_ODBC->ExecSQL(); > > > > Q_ODBC->SQL->Clear(); > > Q_ODBC->SQL->Add("INSERT INTO regn_info VALUES('t1','test1')"); > > > > Q_ODBC->ExecSQL(); > > > > > > Q_ODBC->SQL->Clear(); > > Q_ODBC->SQL->Add("INSERT INTO regn_info VALUES('t2','test2')"); > > Q_ODBC->ExecSQL(); > > > > Q_ODBC->SQL->Clear(); > > Q_ODBC->SQL->Add("ROLLBACK"); > > Q_ODBC->ExecSQL(); > > > > In both cases the ROLLBACK dosen't work and I get the inserted values in > the > > table. > > > > Any idea what can be happening? > > > > Thanks a lot > > > > Javier Diaz > > > > > > > > ------------------------------ > > > > This e-mail is intended for the named addressee only. It may contain > confidential and/or privileged information. If you have received this > message in error, please let us know and then delete this message from your > system. You should not copy the message, use it for any purpose or disclose > its contents to anyone. > > > > > > ________________________________________________________________________ > > This e-mail has been scanned for all viruses by Star Internet. The > > service is powered by MessageLabs. For more information on a proactive > > anti-virus service working around the clock, around the globe, visit: > > http://www.star.net.uk > > ________________________________________________________________________ > > > > --------------------------------------------------------------------- > > 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 > > > *Scanned for all known viruses by Messagelabs* > > ________________________________________________________________________ > This e-mail has been scanned for all viruses by Star Internet. The > service is powered by MessageLabs. For more information on a proactive > anti-virus service working around the clock, around the globe, visit: > http://www.star.net.uk > ________________________________________________________________________ --------------------------------------------------------------------- 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