On Dec 4, 2007, at 3:49 PM, Sabyasachi Ruj wrote:
Hi,
I am getting a problem if I am modifying cache size.
This can be reproduced by the following steps:-
We need two connections to reprodce this.
Say the database name is: "test.db"
*"test.db" SHOULD NOT BE EXISTING ALREADY, WE HAVE TO CREATE EACH
TIME WE
WANT TO GET THE PROBLEM.*
1.
Create a connection to test.db. Here "test.db" should be created
physically.
If it is existing please DELETE it.
We will call this connection as First Connection
2.
Set PRAGMA cache_size = XXXX for this connection
3.
Create another connection to test.db. This is called the Second
Connection.
4.
Creat a a table (say "student_master") in this second connection.
5.
Insert some data in this table through second connection.
6.
Then try to select from the same table with the first connection.
This is failing because the internal representation of the database
schema used by the first connection has not yet been updated to
include the changes made in step 4 by the second connection.
After the sqlite3_prepare() in step 6 fails with the "no such table"
error, SQLite realises that it may be using an old schema version and
discards it. The new schema will be loaded fresh from the database
next time a call is made to sqlite3_prepare().
So the easiest fix is just to retry the sqlite3_prepare().
I am getting error while preparing the SELECT statement.
And the error is no such table: "student_master".
So I think the changes we are making in the second connection are not
visible.
But I do not understand, why does it work if I am not executing
that CACHE
resize query!
Because in the absence of the cache-resize query, the first connection
does not initialise it's internal schema until step 6. By the time it
is loaded for the first time in step 6 the "student_master" table has
already been added. Hence no problem.
Dan.
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------