I can't get it this (undocumented <http://www.sqlite.org/pragma.html>)
pragma to do anything for me:

$ sqlite3 db/emu.db
SQLite version 3.6.3
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> attach 'db/binned-eich.db' as binned;
sqlite> begin exclusive;
sqlite> pragma lock_status;
sqlite> select complete,count(*) from binned.device_perf_interval group by
complete;
0|34
1|145399
sqlite> pragma lock_status;
sqlite> update binned.device_perf_interval set complete=2 where complete=1;
sqlite> pragma lock_status;
sqlite>
[1]+  Stopped                 sqlite3 db/emu.db
$ ls -lc db/{emu,binned-eich}.db*
-rw-r--r--  1 ceich  ceich  16400384 Jan 29 10:47 db/binned-eich.db
-rw-r--r--  1 ceich  ceich   9379912 Jan 29 10:47 db/binned-eich.db-journal
-rw-r--r--  1 ceich  ceich     77824 Dec 24 14:56 db/emu.db
-rw-r--r--  1 ceich  ceich       512 Jan 29 10:46 db/emu.db-journal

But I did notice my code was doing a BEGIN EXCLUSIVE. Would this cause an
unmodified database to be locked anyway?

Chris

On Thu, Jan 29, 2009 at 2:02 AM, Dan <danielk1...@gmail.com> wrote:

>
> On Jan 29, 2009, at 3:13 AM, Chris Eich wrote:
>
> > I have read http://sqlite.org/atomiccommit.html which seems to imply
> > that
> > all db files in a transaction are locked at the same level as the
> > transaction progresses (i.e. all Reserved, then all Exclusive, ...).
> > This
> > makes sense when all the files are being changed, but I have a use
> > case
> > where I am only modifying one of the attached databases and would
> > like to
> > leave the main database unlocked.
>
> That should happen automatically.
>
> You can use "PRAGMA lock_status" to query the locks held on each
> file at any time.
>
> Dan.
>
> _______________________________________________
> 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

Reply via email to