Hi,
    I'm having issues making multiple ajax POST calls to functions
that access a database in my web app using sqlite and mod-wsgi.  I
have no issues making requests to one function, but as soon as I call
a different function, I started getting "database is locked" errors.
I've tried setting the variables as global and just accessing them in
the two functions, as well as opening and closing the database in each
function, to no avail.  What's the proper way to interface with a
database if you just have one application function in your code?
Threads?  Persistent connections?  I've used Django before, but wanted
something bare-bone for this simple app running on my local machine.

the relevant section of code is:
con = sqlite3.connect("/var/www/Knowledge/eurisko.sqlite")
con.row_factory = sqlite3.Row
cursor = con.cursor()
cursor.execute("update notes_content set c1content=?, c2timestamp=?
where c0title=?", [content, timestamp, title])
con.commit()
cursor.close()
con.close()

the full file is here: http://pastebin.com/7yuiZFi2

I'm running apache 2.2 on ubuntu 10 with libapache2-modwsgi and python
2.7.

many thanks,
imran

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en.

Reply via email to