I have been using JRuby in Rails while developing a small demo of using GemStone persistence in place of ActiveRecord. I found that detaching the runtime by sticking the runtime in a thread local 'currentInstance' did not quite do the trick.

It seemd to work fine in plain old Ruby scripts, but Rails apparently uses runtimes differently. In particular, it looks like RubyNil's getRuntime() gets called in a thread that does not have a thread local runtime. So I put in lazy initialization (using a default instance of runtime) in the Ruby.getCurrentInstance() method and that fixed it. Can anyone explain the workings of Rails and how (and when) it creates or uses runtimes? I think I will need some pointers to get this right.

---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email

Reply via email to