Hi. On Mon, Apr 29, 2002 at 08:41:16AM +0100, [EMAIL PROTECTED] wrote: > Hi, > > Can anybody help with the problem that I posted last week (26/04/2002 > 11:31) regarding deadlock errors via the Perl DBD::mysql module? > > To summarize, the following ridiculously simple program works fine when > run in isolation, but immediately leads to deadlock when two are run > together.
How do you determine the deadlock? It is an endless loop, isn't it? > ------------------------------ > # Database "test" as follows: > # CREATE TABLE x (id INT) TYPE=BDB > > use strict; > use warnings; > > use DBI; > > my $dbh = DBI->connect('dbi:mysql:test', 'root', '', > {AutoCommit => 0, PrintError => 0, RaiseError => 1}); > > for (my $i = 0; ; $i++) { > $dbh->do("INSERT INTO x (id) VALUES ($i)"); > $dbh->commit(); > } > > $dbh->disconnect(); > ------------------------------ > > There are no such errors when using DBD::ADO instead of DBD::mysql (... > but DBD::ADO doesn't support bind parameters), or when using a Sybase > database instead. > > I originally posted my query to the msql-mysql-modules mailing list, but > was told that since DBD::mysql is just a thin layer over the C API I > should post my query here instead. Well, I have a quite good understanding of the C API, but that doesn't help me to understand what DBI makes of it. I had to look up what effects has {PrintError => 0, RaiseError => 1}. > I haven't had a single reply yet! Does nobody on this list use the > Perl API? Sure people are using the Perl API. But that doesn't mean that they know what problem you encounter nor how to solve it. E.g. I skipped your message the first time as soon as I saw that it's mainly a Perl problem, because I am not good with Perl. Okay, you said you excluded DBI as probable cause. We have DBD::mysql and the MySQL server left. To rule out the server, I would print out the INSERTs into a file and then run mysql test < file_with_inserts from two clients to see if you can reproduce the deadlock this way. And try it from a different client (i.e. different Perl installation), if you can. Bye, Benjamin. -- [EMAIL PROTECTED] --------------------------------------------------------------------- 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