Re: [pysqlite] database locked

Gerhard Häring <[email protected]> Mon, 26 May 2008 18:10:47 +0200
Newsgroups gmane.comp.python.db.pysqlite.user
Message-ID <[email protected]>
Eric S. Johansson wrote:
> Lately I've been getting "database lock" error exception in my application.  It 
> usually happens when the system is under heavy load.  From what I've read, this 
> error message shows up whenever a transaction times out.  In my environment, 
> timeout is not option, I need to keep retrying until I succeed.  What's the best 
> way to work around "database locks" exceptions?  I tried increasing the timeout 
> value to something like 500 seconds but I still keep getting the exception.

Caveat: 98 % op my experience with experiments/reading when people arise 
this very issue. I don't use pysqlite myself in scenarios where this 
happens.

AFIK the only way to solve this is by

1) rolling back the transaction
2) playing back the whole transaction

I wouldn't increase the timeout above sensible transaction lengths; most 
likely you'll just get the same problem. The rollback/replay should OTOH 
resolve any locks and even deadlocks, eventually.

-- Gerhard