The best answer is probably https://github.com/alex/alchimia
On Tue, Sep 19, 2017 at 1:59 PM Goffi <go...@goffi.org> wrote: > Hello, > > I'm using Sqlite3 module through Twisted's enterpirse.adbapi, I create the > ConnectionPool instance like this: > > self.dbpool = ConnectionPool("sqlite3", db_filename, > check_same_thread=False) > > You can see the code at > https://repos.goffi.org/sat/file/tip/src/memory/sqlite.py > > Sometime, the writing is failing with following exception: > > Failure instance: Traceback: <class 'sqlite3.OperationalError'>: > database is > locked > > So I wonder if the database is correctly used, did anybody experienced > something similar with Twisted and Sqlite ? > > Should I just augment timeout as advised at https://stackoverflow.com/a/ > 8618328? Looks like more a workaround than a clean solution. > > Python 2 documentation doesn't talk about check_same_thread argument, but > Python 3 at > https://docs.python.org/3.5/library/sqlite3.html#sqlite3.connect > says that writing operation should be serialized by the user (I thought it > was > the default as said in https://sqlite.org/threadsafe.html), how should I > achieve that? > > Also PRAGMA are not working (specially "PRAGMA foreign_keys = ON"), I guess > because of multi-threading, what is the good way to activate foreign_keys > for > all following request? > > Thanks in advance > > Goffi > > _______________________________________________ > Twisted-Python mailing list > Twisted-Python@twistedmatrix.com > https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python >
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python