title: Sqlite3, SQLSTATE[HY000]: General error: 5 database is locked
body: <p>I have this little test script:</p>
  
  <pre><code>session_start();
  session_write_close();
  error_reporting(-1);
  register_shutdown_function(function() {
      //echo 'shutdown';
  });
  
  $MAX = 120;
  set_time_limit($MAX);
  echo date('Y-m-d H:i:s').'&lt;br&gt;';
  $m = microtime(true);
  $file_db = new PDO('sqlite:'.dirname(__FILE__).'/test.sqlite3');
  $file_db-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  $file_db-&gt;exec("CREATE TABLE IF NOT EXISTS messages (id INTEGER PRIMARY KEY AUTOINCREMENT, title TEXT, message TEXT, time INTEGER)");
  
  $d = date('U');
  do
  {
      $file_db-&gt;exec ('INSERT INTO messages VALUES (null, "titleee'.rand(1,9).'", "MESSAGEEEE'.rand(1,99).'", "'.rand(1,999).'")');
      if (date('U') - $d &gt; $MAX/2)
      {
          break;
      }
  } while (true);
  $file_db = null;
  echo 'ok: '.(microtime(true)-$m);
  </code></pre>
  
  <p>if this is run in browser in multiple instance, sooner or later it drops "SQLSTATE[HY000]: General error: 5 database is locked" exception. How to dodge it?</p>