Autor: Kelley Reynolds Data: A: Exim Mailing List Assumpte: Re: [exim] exim snapshot with sqlite on openbsd ...
On Aug 4, 2005, at 11:57 AM, Philip Hazel wrote:
> On Thu, 4 Aug 2005, Wild Karl-Heinz wrote:
>
>
>> Do I run into a problem with locking the
>> database, when the server is bussy from
>> time to time.
>>
>
> This is probably something you'll have to experiment with yourself. I
> know pretty well nothing about sqlite. The patch was contributed,
> though
> I modified it quite extensively to make it more general. The code does
> not appear to take any specific locking action; my assumption was that
> this is all handled internally in the library. The web page states,
> as one of the features of sqlite:
>
> Transactions are atomic, consistent, isolated, and durable (ACID)
> even
> after system crashes and power failures.
>
> which sounds like the right sort of thing...
I think what Wild means is that the database gets locked during a
transaction so that if you were to execute a query during this locked
period, it wouldn't get executed, but instead say 'Hey, the database
is locked'. I've used sqlite with ${run} before and the command-line
version will say 'database is locked' then exit without executing a
query. Probably what is required is to retry a certain number of
times or somehow queue the queries such that if the database is
locked (it's a single file, btw), it will wait until it's not locked
anymore (which is what I did with a wrapper script)
I've not looked at the exim code in question, so I couldn't say
whether or not it handles this locking condition properly. It might
return 'fail' for instance.