On Wed, 08 Oct 2014 17:45:29 -0400, Mark Halegua
<phanto...@mindspring.com> wrote:

> I have an application I'm using sqlite3 as the database for.  The program is 
> designed to 
> view and add/edit information.  The viewing part is set up and working nicely 
> using pysqlite 
> and wxpython.
>
> What the problem is is from viewing trying to add data.  I get a database is 
> locked error.
>
> I think my problem is I've opened the database in different modules for 
> different views of the 
> data (there are six tables, one of which relates to two/three others, another 
> which relates to 
> one other) and therefore the database is locked for anything like adding data.

What isolation_level do you use for the connections?

https://pysqlite.readthedocs.org/en/latest/sqlite3.html#sqlite3.Connection.isolation_level
https://pysqlite.readthedocs.org/en/latest/sqlite3.html#sqlite3-controlling-transactions

What journalling mode do you use? Mode WAL might be useful here.

http://www.sqlite.org/pragma.html#pragma_journal_mode

> I've looked for ways to mitigate this behavior, globalizing the database 
> access perhaps, or 
> simply making the add functions a totally separate program (which would be, I 
> think, a poor 
> way to do this).  It might help if there were wsome way to determine the 
> database status in 
> some way which could tell me what state it's in (open for viewing, locked, 
> unlocked, etc).
>
> Can anyone help with some clues for me?

I hope the hints above help.

-- 
Regards,

Kees Nuyt
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to