Ted wrote:
> I get the following error:
>
> ERROR 1205 (HY000) at line 20: Lock wait timeout exceeded; try
> restarting transaction
>
> This ONLY happenes when I start 2 to 4 concurrent processes. The
> scripts involved typically take half a day to a day to complete
> (they're rather intensive analysis and simulation scripts), but they
> should not interact. While they do write to the same tables, they
> spend no more than 5% of their time writing to the tables. Rather,
> most of their time is spent either reading data or number crunching.
> I would think that since the machine in question has a quad core
> processor, it should be able to handle four concurrent sessions even
> though these sessions will each max out one core. For some reason,
> running a single script at a time maxes out one core leaving the other
> three mostly idle. Running four maxes out all of the cores, but
> inevitably the above error kills one session at a time until there is
> only one left, which runs to completion.
>
> What can I do to fix this so I can successfully run four of my scripts
> at a time?
>
> BTW: If it matters, this is with MySQL 5.0.45 running on Windows 2003
> server (both 64 bit).
>
> Thanks
>
> Ted
>
Sounds like you're getting into a deadlock situation. It doesn't matter
what percentage of time any transaction spends writing to the database;
deadlocks can occur any time two or more transactions are updating two
or more tables each, unless care is taken in how the updates are performed.
First of all, try this wikipedia article for an explanation on deadlocks
- it's pretty accurate:
http://en.wikipedia.org/wiki/Deadlock
It also gives some good hints on avoiding deadlocks, such as ensuring
all updates are done in the same order in all transactions.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================