Benjamin Pflugmann wrote:

>On Mon, Apr 29, 2002 at 08:41:16AM +0100, [EMAIL PROTECTED] wrote:
>
>>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?
>
Something (I don't know whether it is BerkeleyDB, MySQL or DBD::mysql) 
detects that deadlock has occurred and seems to rollback the transaction 
being performed by one client, so as to let the other client's 
transaction complete.

Because my program has the "RaiseError" flag set, the do() method in the 
client that was chosen to be rolled back raises an exception, and that 
program die()'s with an error message informing you that the transaction 
was aborted due to deadlock and needs to be retried:

"DBD::mysql::st execute failed: Deadlock found when trying to get lock; 
Try restarting transaction at D:\Temp\deadlock.pl line 14."

>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.
>
I tried this and couldn't reproduce the deadlock.  I'm not sure what the 
"mysql" program would do if it ran into deadlock (would it roll one 
client's transaction back and fail, rollback and retry, or hang 
indefinitely?), but anyway I started with an empty test database, asked 
each client to do 10,000 inserts and finished up with 20,000 rows, so it 
looks like they both completed.

I guess that shows it's a DBD::mysql problem, which I did suspect since 
the DBD::ADO interface works.

With this, it's probably worth me going back to the mysql-mysql-modules 
list.

Thanks!

Steve Hay



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