Re: [pysqlite] Erratic behavior under high loads, with APSW code sample
Glenn Maynard <[email protected]> Mon, 30 Jun 2008 12:25:58 -0400
| Newsgroups | gmane.comp.python.db.pysqlite.user |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Jun 30, 2008 at 06:09:11AM -0500, Frank McIngvale wrote: > Hi, I'm having a strange problem with APSW & pysqlite that shows up under > higher loads. I've attached two files -- running them like this shows the > problem (this occurs under both APIs, I just wrote this sample for APSW): > > $ rm -f test.db; python raw_apsw.py & python raw_apsw.py & python > raw_apsw.py > $ python r.py > > This should show "ROWS=90" at the end. Under Windows (both XP and Vista) > this is rock-solid. Under Linux however, the results are erratic, and almost > always significantly less than 90. I've tried this under both Ubuntu 8.04 > (linux-2.6.24, apsw 3.3.13, sqlite 3.4.2) and RedHat ES 4 (linux 2-6.9, apsw > 3.5.9-r1, sqlite 3.5.9). As I understand it, SQLite's auto-transaction > feature should keep the INSERTs isolated, but I've also tried this same > sample using explicit BEGIN EXCLUSIVE/COMMIT/ROLLBACK, with the same > results. Without adding a conn.commit(), this doesn't add any rows for me at all (with sqlite3). I'm not sure why anything would ever be written without not committing. I always just turn off auto-transactions and do it myself; an API trying to magically figure out when I want a transaction is very strange... -- Glenn Maynard