Hi Richard,

So just for my understanding, let's say I have a WAL enabled database and I
have a "queue sender" application that just constantly sends and sends
messages, are you saying that a "queue receiver" cannot "receive and delete
the message" from the same DB until the sender releases that whole DB file
after sending?

>From what I understand below it should be possible but they will "share" the
processing on "whoever gets the lock" at that time?

I have a problem that while my SENDER is sending to a queue, for example, a
small snippet:

20101115140513  Message sent successfully!...79
20101115140513  Message sent successfully!...80
20101115140513  Message sent successfully!...81
20101115140513  Message sent successfully!...82
20101115140513  Message sent successfully!...83
20101115140513  Message sent successfully!...84
20101115140513  Message sent successfully!...85

The RECEIVER running at the same time (just a snippet below) can READ but
cannot DELETE the messages

Received IDoc: 1234567890  276
Could not delete...:1401
Received IDoc: 1234567890  277
Could not delete...:1401
Received IDoc: 1234567890  278
Could not delete...:1401
Received IDoc: 1234567890  279
Could not delete...:1401
Received IDoc: 1234567890  280
Could not delete...:1401
Received IDoc: 1234567890  281

This doesn't sound right does it?

Thanks

Lynton

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Richard Hipp
Sent: 15 November 2010 02:05 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] WAL and multiple writers?

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

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

Reply via email to