You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having some issues with concurrency. I'm using rdflib-sqlalchemy with a sqlite backend and I see this error from time to time
sqlalchemy.exc.OperationalError
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database is locked
[SQL: PRAGMA main.table_info("kb_cabe862c6b_asserted_statements")]
(Background on this error at: http://sqlalche.me/e/e3q8)
I think I might be opening/closing too many connections, but I'm not sure how to handle this.
What is the correct usage for dealing with concurrent requests? Should I open a global rdflib.Graph() object and keep using that? I think SQLAlchemy is supposed to maintain a connection pool and handle concurrency automatically, but I still see these errors.
Thank you.
The text was updated successfully, but these errors were encountered:
It's difficult for me to say without a small, self-contained example of the issue you are experiencing, but it looks like SQLite isn't designed for a high degree of write concurrency which may be important to consider for your use-case.
With regard to pooling, rdflib-sqlalchemy creates one SQLAlchemy Engine for every instantiation of the store, so if you want to take advantage of connection pooling at that level, then you'd probably want to reuse the same RDFLib Store/Graph. Also note that you can pass arguments to create_engine if needed to tune connection pooling parameters.
I'm having some issues with concurrency. I'm using rdflib-sqlalchemy with a sqlite backend and I see this error from time to time
I think I might be opening/closing too many connections, but I'm not sure how to handle this.
What is the correct usage for dealing with concurrent requests? Should I open a global rdflib.Graph() object and keep using that? I think SQLAlchemy is supposed to maintain a connection pool and handle concurrency automatically, but I still see these errors.
Thank you.
The text was updated successfully, but these errors were encountered: