[Nitro] re-using a db and threading headaches
nusgnaf at gmail.com
Sat Aug 26 08:32:45 EDT 2006
instance var @store defined in Og::Manager looks very suspecious.from
the comment in the code:
# The store used for persistence. This is a virtual field
# when running in thread_safe mode.
and in close_store it gets called:
I add simple p @store in the og/manager.rb, it seems that it is always
nil, that can explain the error you saw. But how does @store get used?
I still don't know Og enought, hope George may give better explanation
on Og intervals.
On 8/26/06, Alex Pooley <alex at msgpad.com> wrote:
> I've been working around two issues. One I have a solution for, and the
> other issue I have a test case courtesy of manveru.
> 1. When I try to re-use an existing database Og dies on an exception
> that the table already exists. I'm using sqlite. The easy fix is to
> catch the exception in sql.rb at line 139. So instead of
> You end up with something more like
> rescue Exception
> 2. I'm running two threads. The first thread is running tests, and the
> second thread is a mongrel server. Each thread is accessing the Og
> store. Og will die trying to close the store in manager.rb (line 101),
> because @store is nil. manveru came up with this test case while
> discussing the problem on IRC: http://pastie.caboo.se/10334 . This
> occurs in both the repo.nitroproject.org repository, and manveru's
> Alex Pooley (msgpad founder)
> w: http://msgpad.com
> e: alex at msgpad.com
> b: http://alexpooley.com
> Nitro-general mailing list
> Nitro-general at rubyforge.org
More information about the Nitro-general