> Just to be clear, I think Windows is really the one that is at fault
> here; the behavior seems very broken to me. Unfortunately, I need the
> app to work on Windows without this happening, so I need to figure out
> some kind of workaround in a.) Windows settings b.) the sqlite source
> or c.) how my app is using sqlite.
>
> Thanks for your help,
> -Stan
>   

Yes, filemon can be extremely useful.  As you've seen, it can really 
help with ordering and sharing problems.

If you think about it, it makes sense that explorer would want to open 
the file only allowing read sharing.  As others have pointed out, you 
wouldn't want an inconsistent copy of the file.  Allowing only shared 
read access is the easiest way to get that.  Once that first opens 
fails, explorer seems to have a fall back plan.  I can only speculate at 
this point what that is.  If I simply had to guess, I would say that 
explorer might be creating a memory map of the file, possibly with copy 
on write semantics.  It could then read from the map to perform the 
copy.  Writes outside explorer would automagically not be seen by the 
process performing the copy, in this case explorer.  It's the first 
thing that comes to mind that might chew up so much RAM/page file.  
However that's just a guess. 

It looks like explorer is making an honest effort to see that you don't 
get an inconsistent copy of the file.  IMO, that isn't broken, but 
desired in the generic case.  Making consistent copies of giant files 
that are in use elsewhere is not what explorer was made for.  That's 
more of a job for a backup application.

If you simply must go down this route, I would try to post your question 
(in a more generic, less SQLite centric form) to one of the Windows 
internals forums, maybe an NTFS forum like NTFSD over at OSR online, 
etc.  You might look for a forum on MSFT's site.  I'm sure someone has 
already been down this road and can give you a specific explanation.

In the meantime, you may want to look at the backup interface provided 
by SQLite.  This should avoid any problems with getting an inconsistent 
snapshot which you just can't avoid with explorer even if you solve the 
RAM issue.  You could write a command line program that just performs a 
copy on a database in short order to use in place of explorer.  Someone 
here could probably post pseudo code for that in just a few minutes.  
Maybe this presents its own set of problems, I don't know.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to