Fatal PHP error on Drupal 7 with IIS Logging as Admin user on Drupal 7 website stored on an IIS machine, I get the following error:

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: 
General error: 2006 MySQL server has gone away' 
in E:\inetpub\wwwroot\teams\includes\database\database.inc:2139  
Stack trace: 
#0 E:\inetpub\wwwroot\teams\includes\database\database.inc(2139): PDOStatement-&gt;execute(Array)
#1     E:\inetpub\wwwroot\teams\includes\database\database.inc(664): DatabaseStatementBase-&gt;execute(Array, Array) 
#2 E:\inetpub\wwwroot\teams\includes\database\database.inc(2318): DatabaseConnection-&gt;query('SELECT expire, ...', Array, Array) 
#3 E:\inetpub\wwwroot\teams\includes\lock.inc(167): db_query('SELECT expire, ...', Array) 
#4 E:\inetpub\wwwroot\teams\includes\lock.inc(146): lock_may_be_available('schema:runtime:...') 
#5 E:\inetpub\wwwroot\teams\includes\bootstrap.inc(420): lock_acquire('schema:runtime:...') 
#6 E:\inetpub\wwwroot\teams\includes\bootstrap.inc(442): DrupalCacheArray-&gt;set(Array) 
#7 [internal function]: DrupalCacheArray-&gt;__destruct() 
#8 {main} thrown inE:\inetpub\wwwroot\teams\includes\database\database.inc on line 2139


Any idea on how do I debug those statements? And how do I release locks?
Indeed, setting maximum allowed packet size in MySQL worked like charm. To solve, we've went to the [mysqld] section of my.ini and added the following:

[mysqld]
max_allowed_packet=100M


then restarted the Windows server machine in order to restart MySQL.

The only difference in IIS is that the machine required a boot.