[cse491] Locking error
Alex Nolley
nolleyal at msu.edu
Sat Oct 18 16:41:37 PDT 2008
Ok that works. I closed all my open python sessions and then retried the
tests and they all passed, no problem. That locking feature can certainly
produce some odd errors. Thanks for your help Eric.
-Alex
The add_user function doesn't need to be called at the time of this error
for it to happen. If there are any connections to the database that have
not been committed then this error can occur. Mine got me a couple of times
when I had an Idle session connected with un-committed transactions.
Eric
On Sat, Oct 18, 2008 at 7:27 PM, Alex Nolley <nolleyal at msu.edu> wrote:
That's what is stumping me because not only do I do a conn.commit() at the
end of my add_user function, but the add_user function isn't even being
called when this error is thrown.
-Alex
This happens when you don't do a c.commit() after your done doing stuff with
the database in add_user.
Eric
On Sat, Oct 18, 2008 at 6:59 PM, Alex Nolley <nolleyal at msu.edu> wrote:
Hey I keep getting the error 'database is locked' when I run the tests. This
occurs on line 540 of the webserve-test.py file. When I open a python
interactive terminal and run each command through it:
import webserve
conn = webserve.conn
c = conn.cursor()
c.execute("DELETE FROM users WHERE username='foo'")
I get the same error, so whatever the error is, it isn't related to a
previous test being run. I created the conn object directly under the import
statements like so:
conn = sqlite3.connect('webserve-info.db')
and I have a feeling this is related to the error but I don't know why. Does
anyone know how to solve this problem?
Thanks,
Alex
_______________________________________________
cse491-fall-2008 mailing list
cse491-fall-2008 at lists.idyll.org
http://lists.idyll.org/listinfo/cse491-fall-2008
No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.138 / Virus Database: 270.8.1/1731 - Release Date: 10/17/2008
7:01 PM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.idyll.org/pipermail/cse491-fall-2008/attachments/20081018/53cdb4cb/attachment.htm
More information about the cse491-fall-2008
mailing list