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); 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 -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
Re: Inno DB Question
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
RE: Inno DB Question
Hi Tod, thanks for your answer. I changed the code to this Q-SQL-Clear(); Q-SQL-Add(SET AUTOCOMMIT=0); Q-ExecSQL(); Q-SQL-Clear(); Q-SQL-Add(BEGIN); 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(); And now for the ODBC connection is working fine, but the same code using TSQLQuery (dbExpress Component) dosen't work. Do you have any idea what can be the reason? Thanks Javier -Original Message- From: Tod Harter [mailto:[EMAIL PROTECTED]] Sent: 02 September 2002 15:58 To: Javier Diaz Subject: Re: Inno DB Question On Monday 02 September 2002 07:37 am, you wrote: I would think you would want to set autocommit BEFORE you call BEGIN since that starts your transaction. My guess would be that setting autocommit clears any existing transaction. In the case without the begin and autocommit set to 0 I don't really know what is going to happen... Essentially you're telling the database I'll tell you when to create a transaction and then you don't create one. I can only assume the behaviour is that mysql goes back to the 'autocommit 1' state at that point since otherwise whatever you're doing makes no sense. 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 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 -- 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
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
Re: Inno DB question
Stanislav, how big is the insert and update load to your table? One user of InnoDB says that it copes with his average load of 800 inserts/updates per second. The computer has 4 processors. Since InnoDB has the non-locking consistent read, SELECT queries do not stop inserts or updates to your table. When you delete data from the big table, it may be best to do it in smaller batches. Because of multiversioning InnoDB cannot internally use DROP TABLE if you issue a full delete: DELETE FROM yourtablename. In simple join queries InnoDB is the fastests disk-based database backend in the world, at least I have not measured bigger numbers for any other disk-based database. A main memory database Polyhedra got about the same numbers for small join queries and somewhat less on bigger. See www.innodb.com/bench.html for benchmarks. In inserts and updates InnoDB is about as fast as MyISAM. In them most of the CPU time goes to Perl (if you use Perl) and client-server communication. About stability: the best reference is the page http://www.innodb.com/bugfixes.html and the mailing lists of MySQL. A problem is that people do not write to the mailing list when it works ok. Regards, Heikki Innobase Oy Copied message: . G'day, I have a question about using InnoDB format of tables with MySQL. We have a following problem: our application collects data into MySQL database during some period of time (say 1 hour) and then we need to analyze these data then move insert results of analysis into other table within same db and then clean first table. The problem is, what during analysis (it takes 30-40 secs) we have a lot of pending queries (due to lock on target table) and then all these pending queries start to execute the system load becomes to high. Can it be faster if we will switch to using InnoDB tables instead of MyISAM? How stable is InnoDB implementation in MySQL ? And more important, how fast is it ? With best regards, Stanislav Dmitrenko - 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