Re: all python threads hung
| Newsgroups | gmane.comp.python.db.pysqlite.user |
|---|---|
| Message-ID | <090720071330.13967.46E1525A000985360000368F220076219401029D0E080C0B@comcast.net> |
> Are you using the latest version of pysqlite? 2.3.5 has improved concurrency a > little. Yes. I just upgraded to 2.3.5 in the hope that would help improve the situation! I didn't see any performance improvement, but my system is limited by flash memory access. > In the past I've experienced that schema changes (any, even CREATE TEMPORARY > VIEW) can cause problems for other database connections. They'll then get schema > errors and will need to be recompiled (pysqlite does that transparently). Yes. I ran into the long ago and removed all uses of views to avoid it. > Of course pysqlite does release the GIL (*) when calling the SQLite API, so that > can hardly be the cause for your problem. One writer, multiple readers sounds > like it should not be a problem, though. I wonder if there is anything special about creating a database connection? The readers all access the database through an abstraction class. Since I believe you can not create a connection in one thread and use it in another I open and close the connection each time a request is made. (I could cache the connections for each thread, but I'm not sure how to determine what execution thread I'm in.) Any other thoughts? > -- Gerhard > > (*) The GIL is released for nontrivial calls, like compiling queries and > fetching results. Aquiring and releasing locks is a small overhead as well, so I > removed some GIL releases for trivial SQLite API calls for the last release. > > _______________________________________________ > pysqlite mailing list > pysqlite-IAPFreCvJWPBWskQ1e/[email protected] > http://lists.initd.org/mailman/listinfo/pysqlite