diff --git a/includes/database/sqlite/database.inc b/includes/database/sqlite/database.inc
index cf3b955..0a94e9d 100644
--- a/includes/database/sqlite/database.inc
+++ b/includes/database/sqlite/database.inc
@@ -37,19 +37,34 @@ class DatabaseConnection_sqlite extends DatabaseConnection {
   /**
    * All databases attached to the current database. This is used to allow
    * prefixes to be safely handled without locking the table
-   * 
+   *
    * @var array
    */
   protected $attachedDatabases = array();
 
   /**
+   * SQLite cannot perform concurrent writes to a database file. If two
+   * processes attempt to write to a file concurrently, the second must wait
+   * for the file to become unlocked. Most of the time this will happen quickly,
+   * but in some cases (such as when several nodes are being indexed by the
+   * Search module), the second process will be waiting too long and cause the
+   * SQLite PDO driver to throw an exception (General Error: 5 database is
+   * locked). The PDO driver will be told to wait this many seconds for the file
+   * to become unlocked before throwing that exception.
+   *
+   * @var int
+   *
+   */
+  protected $busyTimeout = 60;
+
+  /**
    * Whether or not a table has been dropped this request: the destructor will
    * only try to get rid of unnecessary databases if there is potential of them
    * being empty.
-   * 
+   *
    * This variable is set to public because DatabaseSchema_sqlite needs to
    * access it. However, it should not be manually set.
-   * 
+   *
    * @var boolean
    */
   var $tableDropped = FALSE;
@@ -68,6 +83,8 @@ class DatabaseConnection_sqlite extends DatabaseConnection {
       PDO::ATTR_CASE => PDO::CASE_LOWER,
       // Convert numeric values to strings when fetching.
       PDO::ATTR_STRINGIFY_FETCHES => TRUE,
+      // Set a ong busy timeout in case the database file is locked.
+      PDO::ATTR_TIMEOUT => $this->busyTimeout,
     ));
 
     // Attach one database for each registered prefix.
