Error when Exporting to MySQL database


I am currently attempting to analyze the images from a 96-well plate in the Cell Painting format. I am using the following pipeline from Bray et al. Nat Protoc, 2016, 11, 1757-1774 (doi:10.1038/nprot.2016.105). 211analysis.cppipe (39.4 KB) in Cell Profiler 2.1.1.

However I am receiving the following error after analyzing a few image sets.

Traceback (most recent call last):
  File "cellprofiler\pipeline.pyc", line 1934, in run_image_set
  File "cellprofiler\modules\exporttodatabase.pyc", line 1754, in run
  File "cellprofiler\modules\exporttodatabase.pyc", line 2917, in write_data_to_db
  File "cellprofiler\modules\exporttodatabase.pyc", line 262, in execute
  File "MySQLdb\cursors.pyc", line 174, in execute
  File "MySQLdb\connections.pyc", line 36, in defaulterrorhandler
OperationalError: (1205, 'Lock wait timeout exceeded; try restarting transaction')

I found something reported on the issue:

However we are not running on a cluster. The PC is running 16 workers (16 core CPU). Is this causing the issue?

I can press “Continue Processing…”, and if I tick off “Don’t show this error again” the analysis will proceed, but I am not certain that everything is then writting correctly to the database.
Is the issue solved in Cell Profiler 2.2.0, or is there another fix to the problem?

With Kind Regards
Esben Svenningsen
Aarhus University

I think I have solved the issue myself:
I have changed the lock wait timeout by using the following the in MySQL command line:

SET GLOBAL innodb_lock_wait_timeout = 5000; 

And then this:

SET innodb_lock_wait_timeout = 5000; 

I do not know if this is a good solution however, but it fixes the issue.