On 3/10/07, Nuno Lucas <[EMAIL PROTECTED]> wrote:
On 3/10/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Joe Wilson <[EMAIL PROTECTED]> wrote:
> > --- [EMAIL PROTECTED] wrote:
> > > Is there something that the SQLite core can do better?
> >
> > Perhaps exclusive locks on journal files would help avoid this problem.
> > Or are the -journal and etilqs_* files supposed to be sharable by other
> > sqlite processes?
> >
>
> They are, at least on unix. On unix, both files are opened with
> the O_EXCL flag. How do I do the same thing for windows?
The code does that already. You just pass 0 on the share parameter and
no one can open (or delete) the file until closed. The only difference
to unix is the fact you can't delete a file while open (unless if you
pass the FILE_SHARE_DELETE, which isn't supported by Win9x).
I don't see a problem there. The problem seems to be the journal file
is opened by other programs BEFORE sqlite tries to open it, meaning
sqlite fails to open it in exclusive mode.
Answering to myself again, I'm guessing the programs that don't let
sqlite open the journal files in exclusive mode probably will let it
open in shared mode, so maybe if the journal file is open using the
FILE_SHARE_READ attribute, it will allow both the antivirus and
indexers to also have them open (which I'm guessing open them in read
mode and with sharing enabled), although denying any other program to
open it in write mode.
The only problem may be that sqlite will probably fail to delete them
on the end, but maybe this can be solved with some flag on the journal
file saying it can be ignored if sqlite opens it again, or maybe by
just truncating the file to a zero size.
Regards,
~Nuno Lucas
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------