Re: [pysqlite] database locked
"Eric S. Johansson" <[email protected]> Sun, 01 Jun 2008 11:21:17 -0400
| Newsgroups | gmane.comp.python.db.pysqlite.user |
|---|---|
| Message-ID | <[email protected]> |
apologies for letting this fall on the floor. Things got a bit busy around here. Dennis Lee Bieber wrote: >> (Question: what's the better solution for setting up databases when you have two >> tables, 150,000 entries or more and the other with potentially millions. Should >> each table have its own set of files or should I put both tables in one file?) >> > Are they completely independent, or tightly coupled (do your > operations often perform joins between the tables)? Keeping everything > in one database /may/ make it easier to ensure consistency (I don't > recall how much of referential integrity SQLite supports vs having one > explicitly code for such). No, they are independent from each other once the data from the first is used to update the second. None of the operations on the second data set affect the first.It sounds like it's probably appropriate to use separate databases >> > If you can, it probably would be better to formulate the SQL to > generate the needed sort order and limit the results. Then fetchall, and > commit if you only need a read-only transaction. okay, this confuses me. I would think you would want to commit only after update or insert > """ > In case of SQLITE_BUSY, pysqlite2 transparently tries to execute the > statement again repeatedly, until a specified timeout is reached, then > raises an exception > """ > > So that timeout may be on top of the SQLite internal locking > timeout. Might be getting hit twice -- multiple pysqlite connections > retrying update/writes when the SQLite locks report busy, but neither > connection willing to drop all the way out. > What do I need to do in order to create a busy exception? Is it as simple as doing an insert in one process, then sleeping for 15 minutes while a second process tries to repeat the operation?