Ticket #9409: database_is_locked_docs.diff

File database_is_locked_docs.diff, 1.5 KB (added by mrts, 6 years ago)

Docs that explain the reason of and solution for the error (AFAICS).

  • docs/ref/databases.txt

    278278attempts to import ``pysqlite2`` before that ``sqlite3`` and so it can take
    279279advantage of the new ``pysqlite2``/SQLite versions.
     281``OperationalError: database is locked`` errors
     284``OperationalError: database is locked`` errors indicate that your application
     285is experiencing more concurrency than ``pysqlite`` can handle in default
     286configuration. Note that a SQLite database is essentially accessed in serial
     287manner in threaded environment, so the error means that one thread has an
     288exclusive lock on the SQLite database connection and another thread was trying
     289to use the same connection, but timed out waiting on the lock. ``pysqlite`` has
     290a default timeout value that determines how long the second thread is allowed to
     291wait on the lock before it times out and raises the ``OperationalError: database
     292is locked`` error.
     294To avoid the error, you can either
     296 * use another database backend or
     298 * reduce concurrency by ensuring that your database transactions are
     299   short-lived or
     301 * increase the default timeout value by setting the ``timeout`` option::
     303          DATABASE_OPTIONS = {
     304              # ...
     305             "timeout": 20,
     306              # ...
     307          }
    281309.. _oracle-notes:
    283311Oracle notes
Back to Top