Lock wait timeout exceeded

Lock wait timeout exceeded

am 25.03.2004 17:35:20 von Mayuran

BD::mysql::st execute failed: Lock wait timeout exceeded;
Try restarting transaction at /usr/lib/perl5/5.8.0/Test2.pm line 247.

Can someone explain what this error is, what causes it, and how
I can go about debugging/fixing it. The file which caused this error
to be printed is Test.pm but it calls functions in another file Test2
which is where the 'Lock wait timeout exceeded' msg came from. Test2
does not use any transactions, but Test does. Any help would be
appreciated.

thank you,
Mayuran



--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: Lock wait timeout exceeded

am 25.03.2004 20:44:16 von Rudy Lippan

On Thu, 25 Mar 2004, mayuran wrote:

> BD::mysql::st execute failed: Lock wait timeout exceeded;
> Try restarting transaction at /usr/lib/perl5/5.8.0/Test2.pm line 247.
>
> Can someone explain what this error is, what causes it, and how

You have a statement in a transaction that is waiting for something else
to complete before it can continue, and mysql decided that it waited long
enough, so it rolled back the transaction on you.

Simple examle:

tx1: make a change to the database
tx2: select from the table that is changed <-- if you are serializable
this will hang until tx1 commits/rollbacks or will rollback if lock
wait timeout is exceeded.
tx1: commit
tx2: select finishes and returns the data.

> I can go about debugging/fixing it. The file which caused this error
> to be printed is Test.pm but it calls functions in another file Test2
> which is where the 'Lock wait timeout exceeded' msg came from. Test2
> does not use any transactions, but Test does. Any help would be
> appreciated.

Does this always happen or is it something that you see in production
systems where you have more than one user hitting the db? What do
you have your transaction isolation level set to? Do you use any lock
tables() in either module?


Rudy


--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: Lock wait timeout exceeded

am 25.03.2004 20:44:16 von Rudy Lippan

On Thu, 25 Mar 2004, mayuran wrote:

> BD::mysql::st execute failed: Lock wait timeout exceeded;
> Try restarting transaction at /usr/lib/perl5/5.8.0/Test2.pm line 247.
>
> Can someone explain what this error is, what causes it, and how

You have a statement in a transaction that is waiting for something else
to complete before it can continue, and mysql decided that it waited long
enough, so it rolled back the transaction on you.

Simple examle:

tx1: make a change to the database
tx2: select from the table that is changed <-- if you are serializable
this will hang until tx1 commits/rollbacks or will rollback if lock
wait timeout is exceeded.
tx1: commit
tx2: select finishes and returns the data.

> I can go about debugging/fixing it. The file which caused this error
> to be printed is Test.pm but it calls functions in another file Test2
> which is where the 'Lock wait timeout exceeded' msg came from. Test2
> does not use any transactions, but Test does. Any help would be
> appreciated.

Does this always happen or is it something that you see in production
systems where you have more than one user hitting the db? What do
you have your transaction isolation level set to? Do you use any lock
tables() in either module?


Rudy


--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org