On Sunday, April 22, 2012 10:47:04 PM UTC-4, weheh wrote:

> This works fine with sqlite. But postgres and mysql don't work. The 
> problem is when I launch the queue on postgres or mysql, as per above (with 
> or without the -N argument), the db().select(...) doesn't see anything in 
> the db.input_queue table even though there are data in the table.
>
> Anybody have any ideas?
>

I would guess it is a transaction isolation issue: sqlite acquires locks on 
the first write, but postgres (and mysql with innodb tables) will retain a 
view of the database as it were on your first select -- until you 
abort/commit your transaction. As it is, your code will almost never see 
any changes to the database.

Add an "abort transaction" call before your first select, and you'll start 
seeing the records in the database.

Reply via email to