On Mon, Nov 15, 2010 at 5:40 AM, Simon Slavin <[email protected]> wrote:

>
> On 15 Nov 2010, at 10:13am, Lynton Grice wrote:
>
> > Any ideas on having 2 separate applications accessing the same WAL
> enabled
> > database?
> >
> > Or does the first app get an entire lock?
>
> All SQLite locking is locking of the entire database.  SQLite does not lock
> rows, or ranges, or anything like that.  Don't try to manipulate the locking
> system, let SQLite do what it wants to do.  Use transactions and COMMIT them
> as soon as possible.
>

To clarify:  SQLite locks the entire database file - but only for the
duration of each write operation.  So two or more applications can access
the database - they simply have to take turns.


>
> > Can I perhaps set the THREAD mode
> > to help here?
>
> What is it that isn't working as planned for you ?
>
> > I have tried:
> >
> >               rc = sqlite3_exec(handle,"PRAGMA wal_checkpoint",0,0,0);
> >            rc = sqlite3_exec(handle,"PRAGMA synchronous=normal",0,0,0);
> >            rc = sqlite3_exec(handle,"PRAGMA temp_store=memory",0,0,0);
> >
> > And obviously the following as well: "PRAGMA journal_mode=wal"
>
> Try /just/ the "PRAGMA journal_mode = WAL".  Stick with just this PRAGMA
> until you get it working in some shape or form.
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
[email protected]
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to