sqlite3.OperationalError: database is locked

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

sqlite3.OperationalError: database is locked

tfeijo

I can't run my project after trying to use set_backend to handles ontology in real-time. Can anyone help me, please?
 

* Owlready2 * Warning: optimized Cython parser module 'owlready2_optimized' is not available, defaulting to slower Python implementation
Traceback (most recent call last):
  File "/Dev/agrogest/backend-onto/app.py", line 5, in <module>
    from src.routes import *
  File "/Dev/agrogest/backend-onto/src/routes.py", line 4, in <module>
    from src.controllers.CityController import *
  File "/Dev/agrogest/backend-onto/src/controllers/CityController.py", line 3, in <module>
    from src.models.Classes import *
  File "/Dev/agrogest/backend-onto/src/models/Classes.py", line 2, in <module>
    from src.ontology.config import onto
  File "/Dev/agrogest/backend-onto/src/ontology/config.py", line 9, in <module>
    onto = world.get_ontology("bd.owl").load()
  File "/Dev/agrogest/backend-onto/.venv/lib/python3.8/site-packages/owlready2/namespace.py", line 508, in get_ontology
    return Ontology(self, base_iri)
  File "/Dev/agrogest/backend-onto/.venv/lib/python3.8/site-packages/owlready2/namespace.py", line 679, in __init__
    self.storid                = world._abbreviate(base_iri[:-1])
  File "/Dev/agrogest/backend-onto/.venv/lib/python3.8/site-packages/owlready2/triplelite.py", line 485, in _abbreviate_dict
    self.execute("INSERT INTO resources VALUES (?,?)", (storid, iri))
sqlite3.OperationalError: database is locked
Reply | Threaded
Open this post in threaded view
|

Re: sqlite3.OperationalError: database is locked

Jiba
Administrator
Hi,

The "database is locked" error means that the SQLite3 database file is already opened (probably by another Python interpreter, running your program).

You should close the other applications that use the database.

You can also add the "exclusive = False" argument to set_backend(), if you want to have several connection in parallel.

Jiba