Re: [sqlite] questions regarding WAL and Shared Cache Mode

2012-04-30 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 30/04/12 14:52, Sean Cui wrote:
> 1.  The main purpose of Shared Cache Mode is to enable multiple
> connections to a database file WITHIN a process.

No, it is to save some memory.  You can already open up multiple
connections to the same or different databases within a process.  Shared
cache mode just means that if they are to the same file then they'll share
a cache instead of having a unique cache per connection.

For regular SQLite usage (ie not limited embedded devices) I strongly
recommend *not* using shared cache mode.

  http://apidoc.apsw.googlecode.com/hg/tips.html#shared-cache-mode

> 2.  With Shared Cache Mode, Table level locking can be used to
> improve concurrency.

I believe things are still serialised.  There is no magical switch or
setting that makes SQLite go a lot faster.

> 3.  WAL mode increases concurrency by ...

The documentation for WAL clearly explains the advantages and
disadvantages, including how it works.

  http://www.sqlite.org/wal.html

Roger


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk+fGY4ACgkQmOOfHg372QTOBQCg43mgDkWsOLOaetJdCYlnvKWq
u3EAn1MdRlqiPHPiFSsGGyOB+ws5k6gA
=Aky4
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] questions regarding WAL and Shared Cache Mode

2012-04-30 Thread Sean Cui
Hello, this is my first question in the Sqlite mailing list:
I am currently investigating concurrency in SQLite. I found two related topics: 
WAL and Shared Cache Mode. Below is a list of my understandings regarding them:

1.  The main purpose of Shared Cache Mode is to enable multiple connections 
to a database file WITHIN a process.



2.  With Shared Cache Mode, Table level locking can be used to improve 
concurrency.



3.  WAL mode increases concurrency by making Writes and Reads not blocking 
each other.  Writes and Reads can be from one process or from multiple 
processes.
Am I right with the above points?
Thanks,
Sean
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users