Re: timeout parameter

andychambers2002-/[email protected]
Newsgroups gmane.comp.python.db.pysqlite.user
Message-ID <[email protected]>
On 16:55 Fri 15 Sep     , Gerhard Häring wrote:
> Andy Chambers wrote:
> > How exactly does the timeout parameter work?  I wrote up
> > a small test script that simply tries to update a table
> > that is being locked by another process.  I expected the
> > script to fail after about 5 seconds since the documentation
> > says that the timeout is the period of time pysqlite should
> > wait before raising an exception if the databse is locked.
> > What actually happens is that the script fails immediately
> > throwing an OperationalError.
> 
> An error is thrown immediately if a deadlock situation is detected by
> SQLite. If that's not what happened, can you post your test scripts?

I think that must be what happened.  I was locking the database by
opening a transaction in a sqlite session like so...

    $ sqlite
    > begin
    > insert into readings (1, 1);

...and then running a python script that tried to update readings

Thanks,
Andy


		
___________________________________________________________ 
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.