List:MySQL and Perl« Previous MessageNext Message »
From:Steve Hay Date:April 26 2002 8:57am
Subject:Problem with DBD::mysql
View as plain text  
Hi,

I'm experiencing deadlock errors on BDB tables when using DBD::mysql. 
 I've whittled it down to an unbelievably simple program ("deadlock.pl", 
attached).  This program runs fine on its own, but when I run two of 
them together, one of them deadlocks in a matter of seconds.  (I use the 
attached "db.bat" batch file to (re-)create the database which this 
program uses.)

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

I can't understand why this program should have deadlock errors in the 
first place, but what is even stranger (and is why I'm mailing to *this* 
list) is that it runs fine if I use DBD::ADO instead of DBD::mysql.  (I 
also tried DBD::ODBC; that had the same deadlock errors as DBD::mysql.) 
 However, I'm not keen to use the DBD::ADO driver because it doesn't 
(currently) support bind parameters, which I'm making much use of.

Also, the same program with only the DBI connect string changed to 
access a Sybase database works fine with the main Sybase DBD driver 
(DBD::ASAny) and with DBD::ADO and DBD::ODBC.

Any help would be greatly appreciated.

Steve Hay

---

Version info:

OS: Windows NT4, SP6
Perl: 5.6.1, patched to the same level as ActivePerl Build 631
DBI: 1.21
DBD::mysql: 2.1013
DBD::ADO: 2.4
DBD::ODBC: 0.40
MySQL: 3.23.49a-max-nt
MyODBC: 2.50.39


Attachment: [application/x-perl] deadlock.pl
@echo off \mysql\bin\mysqladmin -f drop test >NUL 2>&1 \mysql\bin\mysqladmin create test \mysql\bin\mysql -u root -e "CREATE TABLE x (id INT) TYPE=BDB" test
Thread
Problem with DBD::mysqlSteve Hay26 Apr
  • Re: Problem with DBD::mysqlJochen Wiedmann26 Apr
  • Re: Problem with DBD::mysqlSteve Hay30 Apr
    • Re: Problem with DBD::mysqlJochen Wiedmann30 Apr
  • Re: Problem with DBD::mysqlSteve Hay30 Apr
    • Re: Problem with DBD::mysqlJochen Wiedmann30 Apr
  • Re: Problem with DBD::mysqlSteve Hay30 Apr