Re: [sqlite] WAL and local UNC filenames

2011-11-08 Thread Pavel Ivanov
On Mon, Nov 7, 2011 at 5:48 PM, Jean-Christophe Deschamps
j...@antichoc.net wrote:
 Pavel,

 This is not a local file. Even if you use your hostname as netname
 file is still retrieved through network stack. And I guess SAMBA
 doesn't work well with memory mapped files (in addition to all
 problems with locking).

 True but why did I get no error?  Since MMF don't cope with network it would
 be  good to get a no-no somewhere.  I really don't know which layer should
 bark however.

I can't answer this question. Maybe it's something like all operations
are successful but memory mapping is not actually shared between
processes. So every process sees its own copy and assumes that no
other process works with database, thus database can be corrupted in
many possible ways.

Pavel
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] WAL and local UNC filenames

2011-11-08 Thread Teg

What I've seen is that windows makes a local copy of the memory mapped
file.  Perhaps  in swap. If you watch your application using ProcMon
you can see all the disk IO. That's how I noticed the copy.

For  my  usage,  only  one  process  opens  the  DB  so,  maybe it's a
non-issue.

C

Tuesday, November 8, 2011, 10:05:17 PM, you wrote:

PI On Mon, Nov 7, 2011 at 5:48 PM, Jean-Christophe Deschamps
PI j...@antichoc.net wrote:
 Pavel,

 This is not a local file. Even if you use your hostname as netname
 file is still retrieved through network stack. And I guess SAMBA
 doesn't work well with memory mapped files (in addition to all
 problems with locking).

 True but why did I get no error?  Since MMF don't cope with network it would
 be  good to get a no-no somewhere.  I really don't know which layer should
 bark however.

PI I can't answer this question. Maybe it's something like all operations
PI are successful but memory mapping is not actually shared between
PI processes. So every process sees its own copy and assumes that no
PI other process works with database, thus database can be corrupted in
PI many possible ways.

PI Pavel
PI ___
PI sqlite-users mailing list
PI sqlite-users@sqlite.org
PI http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users




-- 
Best regards,
 Tegmailto:t...@djii.com

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] WAL and local UNC filenames

2011-11-08 Thread Jean-Christophe Deschamps

Hi Pavel,


I can't answer this question. Maybe it's something like all operations
are successful but memory mapping is not actually shared between
processes. So every process sees its own copy and assumes that no
other process works with database, thus database can be corrupted in
many possible ways


Probably something like this.

In fact it did bite me but without too much consequence.  Back in 2008 
(before WAL birth) I parametrized the root of my data files tree so 
that all files in the tree are relative to this root where the DB lies, 
and all individual file relative paths are stored in a Paths table in 
the DB itself.  To make things more flexible I specified the root as an 
UNC path, so I could move the whole tree around without change, 
provided the target machine has the required netname.


Changing \\machine\dbPath\ to D:\dbPath\ fixed it. 


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] WAL and local UNC filenames

2011-11-07 Thread Pavel Ivanov
 Does your path begin with 'file:' ?

 No, simply
 \\netname\share\path\test.db

This is not a local file. Even if you use your hostname as netname
file is still retrieved through network stack. And I guess SAMBA
doesn't work well with memory mapped files (in addition to all
problems with locking).


Pavel


On Sun, Nov 6, 2011 at 10:04 PM, Jean-Christophe Deschamps
j...@antichoc.net wrote:

 Does your path begin with 'file:' ?

 No, simply
 \\netname\share\path\test.db

 ___
 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


Re: [sqlite] WAL and local UNC filenames

2011-11-07 Thread Jean-Christophe Deschamps

Pavel,


This is not a local file. Even if you use your hostname as netname
file is still retrieved through network stack. And I guess SAMBA
doesn't work well with memory mapped files (in addition to all
problems with locking).


True but why did I get no error?  Since MMF don't cope with network it 
would be  good to get a no-no somewhere.  I really don't know which 
layer should bark however. 


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] WAL and local UNC filenames

2011-11-06 Thread Jean-Christophe Deschamps

Dear List,

If a DB in WAL mode is opened using a UNC path refering to a _local_ 
drive, weird things happen until the DB gets corrupted but AFAIK no 
error code is thrown.


Windows doesn't seem to open the memory mapped file if it has a UNC path.

Can someone confirm?

I don't know if this qualifies as bug or library misuse.  Obviously 
using a UNC path in WAL mode is a bad idea but still...


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] WAL and local UNC filenames

2011-11-06 Thread Simon Slavin

On 7 Nov 2011, at 2:02am, Jean-Christophe Deschamps wrote:

 If a DB in WAL mode is opened using a UNC path refering to a _local_ drive, 
 weird things happen until the DB gets corrupted but AFAIK no error code is 
 thrown.

Does your path begin with 'file:' ?

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] WAL and local UNC filenames

2011-11-06 Thread Jean-Christophe Deschamps



Does your path begin with 'file:' ?


No, simply
\\netname\share\path\test.db

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users