>> I think because they need to detect dead locks. BTW, I believe in case
>> of dead lock even busy_handler will not be called, just SQLITE_BUSY is
>> returned...
>>
>    I guess that makes sense, in cases where multiple tables are involved.

No, that makes sense when you're starting deferred transaction, then
do selects, then do update. If this is done by several processes they
can deadlock.

>    How does this preclude me from coming up w/my own lock file with
> POSIX locks? If a bunch of process start making incompatible requests on
> a single lock file, then they'll be queued and processed in order. I
> don't see how you can have a deadlock when you have multiple processes
> putting locks on a single, entire file.

You mean you will lock this extra-file before doing any update and
unlock when update is done? Then ok, it will work. But again be aware
of possible dead locks.

Pavel

On Fri, Sep 18, 2009 at 2:27 PM, Angus March <an...@uducat.com> wrote:
> Pavel Ivanov wrote:
>>> Hell if I know why they use fcntl() for locks, and don't even give
>>> you the option to block.
>>>
>>
>> I think because they need to detect dead locks. BTW, I believe in case
>> of dead lock even busy_handler will not be called, just SQLITE_BUSY is
>> returned...
>>
>    I guess that makes sense, in cases where multiple tables are involved.
>
>>>    I think we are a long way from me screwing around with sqlite's
>>> source. What I'm trying for is a solution with my own source code.
>>>
>>
>> Then neither flock() nor fcntl() will not help you. Your own code have
>> control only over the busy handler which gains control only when
>> database is locked. And it should understand somehow when other
>> process not calling any busy handlers unlocks database... And I
>> believe there's no solution here any better than simple
>> sleep-and-retry.
>>
>
>    How does this preclude me from coming up w/my own lock file with
> POSIX locks? If a bunch of process start making incompatible requests on
> a single lock file, then they'll be queued and processed in order. I
> don't see how you can have a deadlock when you have multiple processes
> putting locks on a single, entire file.
> _______________________________________________
> 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