Re: connection timeout parameter
| Newsgroups | gmane.comp.python.db.pysqlite.user |
|---|---|
| Message-ID | <OFB39BA782.C9DE4A98-ON85257214.006821E6-85257214.00688EC9@bankofny.com> |
According to Gerhard Häring <[email protected]> and I quote: 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? So the error is thrown immediately, so my assumption is you have a couple of choices, you can sleep for a little while and resubmit the query, or you can bail and let the user know. But I have never had a problem like this since I use SQLite for small self-contained apps, if I need a multi-user database then I use MySql or SQLServer or PostSQL some such enterprise version of a a database. :) I know that doesn't give you a real solution, but it does confirm that it is behaving by design. Maybe someone else out on the list has a solution or a work-around. Thanks, Greg Givler Information Technology Lockwood® 10 Valley Stream Parkway Malvern, PA 19355 Phone: (484) 605-4826 Email: [email protected] Bryan <[email protected]> To: [email protected] Sent by: cc: pysqlite-bounces@list Subject: [pysqlite] connection timeout parameter s.initd.org 10/25/2006 07:00 PM Please respond to "For users of the pysqlite database module." i seem to be having the same issue as was posted in a previous thread "timeout parameter". i'm using pysqlite 2.3.2 and python 2.4.3 on windows xp sp2. i have a method that does the following: get new connection (timeout is 30 seconds, isolation_level is default) get new cursor insert sleep 30 seconds commit the method is called in two threads. when the 2nd thread tries to do an insert, it returns immediately with a "DatabaseError: database is locked" exception. i expected the 2nd call to insert to be blocked for up to 30 seconds (i also tried the default timeout of 5 seconds). it seems that the connection timeout values is being ignored. is this a bug or is there a work around for this? thanks, bryan _______________________________________________ pysqlite mailing list pysqlite-IAPFreCvJWPBWskQ1e/[email protected] http://lists.initd.org/mailman/listinfo/pysqlite ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please call the help desk at ext 4850 ______________________________________________________________________ ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________