On Jul 13, 4:41 pm, Joel VanderWerf <[email protected]> wrote:
> What does the "thread safety" of sequel actually mean?
>
> The following code has two threads write to a sqlite database inside
> transactions, but the db gets locked in the middle of the first thread's
> transaction, and then neither thread can proceed. Aren't transactions
> atomic wrt ruby threads?

They are.  The problem is with SQLite, not with Sequel.  You must be
using using too small a timeout (seems odd considering the timeout you
are using and the amount of time you are sleeping, but that's my best
guess).  Really, for multithreaded write access on SQLite, you should
use a :max_connections=>1 option so only one thread attempts to access
the database at once.  Really, you should avoid using SQLite
altogether in such situations (see http://www.sqlite.org/whentouse.html).

Jeremy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to