> Thank you.
>
> I missed the EXCLUSIVE clause in the docs comes with the newbie
> territory,
> i guess.
>
> So to confirm, would something like this work?
>
> Tables:
> task_log => (id, task_data, time_stamp)
> task_fifo = > (id, fk_task_log)
> task_status_log => (id, fk_task_log,
> Wrap the above two statements in:
>
> 0) BEGIN EXCLUSIVE
> ...
> 3) COMMIT
>
> The BEGIN EXCLUSIVE above is all you need (and more, a simple BEGIN
> may be enough).
>
> > Can someone with more knowledge of SQLite internals explain the
> > right way to "atomic"-lly "pop"-off an item
On May 18, 2009, at 5:32 PM, Allen Fowler wrote:
>>> The simple solution would just create a race condition... i think:
>>>
>>> 1) INSERT INTO status_table FROM SELECT oldest task in queue
>>> 2) DELETE oldest task in queue
>>>
>>> Right?
>>
>> It might work fine if you wrap it in an exclusive
> Have you considered using a more generic message queuing program?
> Wikipedia has a good page about it:
>
> http://en.wikipedia.org/wiki/Message_queue
>
> There is even a standardised protocol - AMQP:
>
> http://en.wikipedia.org/wiki/Advanced_Message_Queuing_Protocol
>
> You could
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Have you considered using a more generic message queuing program?
Wikipedia has a good page about it:
http://en.wikipedia.org/wiki/Message_queue
There is even a standardised protocol - AMQP:
> >The simple solution would just create a race condition... i think:
> >
> >1) INSERT INTO status_table FROM SELECT oldest task in queue
> >2) DELETE oldest task in queue
> >
> >Right?
>
> It might work fine if you wrap it in an exclusive
> transaction.
>
"exclusive transaction"? Great!
6 matches
Mail list logo