Closed sharpaper closed 4 years ago
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.