On Thu, Feb 17, 2011 at 9:37 PM, Pavel Ivanov <paiva...@gmail.com> wrote:

> > I'd appreciate it if anyone could let me know if this pragma still
> > works and how to use it if so.
>
> You can get away without pragma. Just implement your own VFS which
> will redirect all calls except lock-related to the standard VFS.
> Lock-related methods would be implemented as no-op and thus won't
> cause any performance problems.
>

That VFS already exists and is loaded by default in Unix builds.  Its name
is "unix-none".  If open the database connection using sqlite3_open_v2() and
specify "unix-none" as the VFS, no locking ever occurs.



>
>
> Pavel
>
> On Thu, Feb 17, 2011 at 4:36 PM, Mike Lin <m...@mit.edu> wrote:
> > Dear all,
> >
> > I have a large SQLite database with genomic data which is strictly
> > read-only at this point, and in direct spite of the FAQ I intend to
> > query it concurrently on a network FS. Our parallel FS ought to be
> > able to handle a heavy read workload from our cluster, based on past
> > experience, but acquiring read locks seems to cause a bottleneck. I
> > have found a few mentions of an experimental 'pragma omit_readlock'
> > which seems just right for this situation, but I have not been having
> > luck making it work so far.
> >
> > I also found the following June 2009 e-mail to this list from Joerg
> > Hoinkis that seemed to make some progress by digging into the SQLite
> > source, but did not get any replies. I have similarly tried some
> > obvious things like opening my database with SQLITE_OPEN_READONLY and
> > making sure my file's permissions are 444.
> >
> > I'd appreciate it if anyone could let me know if this pragma still
> > works and how to use it if so.
> >
> > Thanks,
> > Mike Lin
> >
> >
> >> Hi!
> >>
> >> I'm trying to access a readonly database without locks, using the
> >> amalgamation of SQLite 3.6.14.2
> >>
> >> After I opened the database with flags = SQLITE_OPEN_READONLY I perform
> >>
> >> sqlite3_exec (db, "PRAGMA omit_readlock=ON", 0, 0, 0);
> >>
> >> I traced that down into the amalgamation to the point where the database
> >
> >> flag is set in flagPragma...
> >>
> >> db->flags |= p-mask;
> >>
> >> So I can be sure the pragma syntax is correct.
> >>
> >>
> >> Now when I execute a SELECT statement, it is parsed and I run into
> >> pagerSharedLock, but
> >> the pager->noReadlock variable is 0. As a result the database file gets
> >> locked.
> >>
> >>
> >> It look like the initialization of the pager->noReadlock flag, but that
> >> happens when the database is
> >> opened.
> >
> > I messed up the last sentence, better:
> >
> > It looks like the initialization of the pager->noReadlock flag only
> > happens
> > when the database is opened, but by that time the omit_readlock pragma is
> > not active.
> >
> >>
> >> Am I doing something wrong or did this ("Very experimental") feature got
> >
> >> lost in past refactorings?
> >>
> >>
> >> Thanks for listening & in advance to any hints
> >
> > Joerg
> > _______________________________________________
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to