> >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!  How do I do that?  :)

>From reading http://www.sqlite.org/lockingv3.html it sounds like SQLite very 
>rarely will want to gain an exclusive lock.  I think, not even issuing an 
>INSERT will do that until other factors cause it to flush to disk.

Can someone with more knowledge of SQLite internals explain the right way to 
"atomic"-lly "pop"-off an item from table in SQlite?  (And, in this case, also 
add it to a 2nd table.)



Thank you,
Allen


      

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to