On Sat, 2007-03-10 at 14:11 +0900, Brownie wrote:
> Hi,
>
> I have two questions about shared cache mode of SQLite.
>
> 1. When is shared cache of SQLite deallocated?
> A last call of sqlite3_close()? Or end of thread procedure?
The former. The shared cache (and shared schema) are reference
counted. Resources are released as soon as the number of connections
to the shared cache drops to zero.
> 2. Can I use read_uncommitted isolation in the following case?
>
> (Connection1 and Connection2 is established by the same thread
> and shared cache mode was enabled)
>
> Connection1: Opened for :memory:
> ATTACH DATABASE 'mydb.db' as mydb;
> SELECT myname FROM mydb.mytable;
>
> Connection2: Opened for mydb.db
> INSERT INTO mytable(myname) VALUES('myname');
I think so. But I'm not 100% sure I understand the question.
If Connection1 is in read_uncommitted mode, then the SELECT will
neither block nor be blocked by the INSERT statement executed
by Connection2.
That the first database file was ATTACHed instead of being opened
directly makes no difference.
Dan.
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------