in reply to Re: CGI::Session::MySQL lock problem
in thread CGI::Session::MySQL lock problem

Thank you very much, that was so useful!

I checked the trace log, found
!! ERROR: '2006' 'MySQL server has gone away'
checked what was happening just before it, found...
<- disconnect= 1 at Images.pm line 215

So, I add
$self->param('session')->close;
before
$self->param('dbh')->disconnect();

in my teardown sub, and it's fixed!