[sqlite] Sqlite3 lock issue with NFS and read-only queries

2008-11-19 Thread David Levy
Hi all,

I am experiencing a pretty annoying issue with my Sqlite3 databases.
I am using PDO to access small ( approx. 300Kb ) databases stored on an NFS
v3 mount. These queries are multithreaded as they come from a web
application. However, there are only SELECT statements, not any
update/delete/insert, and I am facing some lock errors, as follow :


SQLSTATE[HY000]: General error: 5 database is locked
Stack:
#0 /home/www/libs/Zend/Db/Statement.php(283):
Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/www/libs/Zend/Db/Adapter/Abstract.php(405):
Zend_Db_Statement->execute(Array)
#2 /home/www/libs/Zend/Db/Adapter/Pdo/Abstract.php(205):
Zend_Db_Adapter_Abstract->query('SELECT * FROM m...', Array)


I am aware of issues using sqlite over NFS. But I was thinking these issues
were related to read/write queries working in parallel, and not to read-only
queries.

Is Sqlite locking the database for *any* query ?
Is there a way to tell Sqlite to not lock the database when we know there
are only read-only queries ?



Thanks !


-- 
David LEVY {Selenium}
Chief Technical Officer - Zlio.com
-
Blog   : http://www.davidlevy.org
ZlioShop : http://shop.davidlevy.org
Music : http://www.davidlevy.org/music/
-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Sqlite3 lock issue with NFS and read-only queries

2008-11-19 Thread David Levy
Thanks Richard,

According to the source code, it's an experimental feature :

/* The following is VERY experimental */
{ "writable_schema",  SQLITE_WriteSchema   },
{ "omit_readlock",SQLITE_NoReadlock},



We have tested today and it does seem to work. The issue occured again.
Which version of sqlite should we be running at least for the feature to
work for sure ?
Should we use

PRAGMA omit_readlock=ON;

or
PRAGMA omit_readlock=1;

?

regards



On Wed, Nov 19, 2008 at 2:14 PM, D. Richard Hipp <[EMAIL PROTECTED]> wrote:

>
> On Nov 19, 2008, at 5:07 AM, David Levy wrote:
> > Is there a way to tell Sqlite to not lock the database when we know
> > there
> > are only read-only queries ?
> >
>
>
> PRAGMA omit_readlock=ON;
>
>
> D. Richard Hipp
> [EMAIL PROTECTED]
>
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
David LEVY {Selenium}
Chief Technical Officer - Zlio.com
-
Blog   : http://www.davidlevy.org
ZlioShop : http://shop.davidlevy.org
Music : http://www.davidlevy.org/music/
-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Sqlite3 lock issue with NFS and read-only queries

2008-11-21 Thread David Levy
Hi again,

Actually it seems that the database file needs read-only (444) permissions
for the feature to work.
We did it also and I still get the same error.
I am checking at the source code from Google and it's not clear enough still
to know what do to :

http://www.google.com/codesearch?hl=fr=SQLITE_LOCKED+show:Z1FdoIsBlOs:vWJLIq9JwCc:aOH-oCi-w94=N=10=rc_p=http://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla1.8b1/source/mozilla-source-1.8b1.tar.bz2_f=mozilla/db/sqlite3/src/btree.c


Can I check with the sql API which locks are opened on a database ?
Another ideas in mind ?

Thanks !



On Wed, Nov 19, 2008 at 6:54 PM, David Levy <[EMAIL PROTECTED]> wrote:

> Thanks Richard,
>
> According to the source code, it's an experimental feature :
>
> /* The following is VERY experimental */
> { "writable_schema",  SQLITE_WriteSchema   },
>
> { "omit_readlock",SQLITE_NoReadlock},
>
>
>
> We have tested today and it does seem to work. The issue occured again.
> Which version of sqlite should we be running at least for the feature to
> work for sure ?
> Should we use
>
> PRAGMA omit_readlock=ON;
>
> or
> PRAGMA omit_readlock=1;
>
> ?
>
> regards
>
>
>
> On Wed, Nov 19, 2008 at 2:14 PM, D. Richard Hipp <[EMAIL PROTECTED]> wrote:
>
>>
>> On Nov 19, 2008, at 5:07 AM, David Levy wrote:
>> > Is there a way to tell Sqlite to not lock the database when we know
>> > there
>> > are only read-only queries ?
>> >
>>
>>
>> PRAGMA omit_readlock=ON;
>>
>>
>> D. Richard Hipp
>> [EMAIL PROTECTED]
>>
>>
>>
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>
>
>
> --
> David LEVY {Selenium}
> Chief Technical Officer - Zlio.com
>
> -----
> Blog   : http://www.davidlevy.org
> ZlioShop : http://shop.davidlevy.org
> Music : http://www.davidlevy.org/music/
>
> -
>



-- 
David LEVY {Selenium}
Chief Technical Officer - Zlio.com
-
Blog   : http://www.davidlevy.org
ZlioShop : http://shop.davidlevy.org
Music : http://www.davidlevy.org/music/
-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users