Faissolle, Julien
2005-Sep-29 08:29 UTC
RE: Re: scgi_rails opens new a database connection for everyrequest?
It seems to me, by looking at the ActiveRecord code (abstract_adapter.rb) that connections are opened and maintained by default on a per Thread basis. This is because Rails is designed to function either with single thread processes (fcgi) or with a pool of Thread which are being reused. The connections are opened once for each thread. If threads are created on each request, connections will be opened each time and will never be explicitely closed.