title: Having a Multithreaded environment in JRuby after ConnectionNotEstablished
body: <p>I have Rails (4.2.6) App where I use Thread(s) for background data processing caused by the Rufus::Scheduler. I have the working app in the development env, but when I move it to production on nginx + passenger I get exceptions <strong>ActiveRecord::ConnectionNotEstablished</strong>, even without sufficient load.</p>
  
  <p>All calls for ActiveRecord::Base's descendants that performing from Threads - are wrapped into </p>
  
  <p><code>ActiveRecord::Base.connection_pool.with_connection{}</code></p>
  
  <p>I've never used multi threaded environments before, but after some surveying of the problem, I suggest that probably this is the matter.</p>
  
  <blockquote>
    <p>Is it reasonable to try it under JRuby and what containter is prefereable?</p>
  </blockquote>
  
  <p>The host system is Ubuntu 14.04 x86_64.</p>