0

I have a Python script running every four hours. This is the crontab line:

* */4 * * * pi python /var/www/scripts/testProg.py >> /var/log/testProg.log

In the /var/log/testProg.log file I can see the following entry over and over again:

Error 1205: Lock wait timeout exceeded; try restarting transaction

My script does do some MySQL related things. Is this because the DB is locked by another process?

uncle-junky
  • 723
  • 1
  • 8
  • 33
  • Try to debug it first: http://stackoverflow.com/questions/6000336/how-to-debug-lock-wait-timeout-exceeded -- If that doesn't work, add more details to your post. – cmt Jun 17 '13 at 14:28
  • Yes. Probably an open ended transaction or some kind of deadlock. – rantanplan Jun 17 '13 at 14:28
  • Some one may have done a transaction and did not commit, or trying to select data from table, and is locked. These are common database errors. You can get this checked with the DBA. – vamosrafa Jun 17 '13 at 14:31
  • Think I found the source of the problem. Thanks for your inputs. I believe it is because after some INSERT and UPDATE statements the con.commit() method of the MySQLdb driver is needed before going to another DML statement. – uncle-junky Jun 17 '13 at 14:37

0 Answers0