Topic: Rails' connection to database

I am wondering how does Rails create connections to the database? If a 1000 users connect to a Rails site, are a 1000 Oracle sessions opened? How are these Oracle sessions closed?

The way I understood from books and online sites is that there is one connection that Rails makes when the server starts up. When users connect to the site, queries are executed over that connection. If FastCGI is setup, then multiple FastCGI servers can be opened so that multiple user requests can be handled over the Oracle connection(s). Is that correct?

I'm running into a problem where every time a user connects to the Rails site an Oracle session is started. The session remains in an "inactive" state until user needs something from the database. Even if these Oracle sessions remain idle, they are not closed. Do I need to tell Oracle to close the Oracle session if the user's browsing session is finished? How is this done? I'm trying to understand how Rails makes the connection in order to fix the problem.

If the Oracle session is not closed, then I'm not sure how multiple users can connect to a Rails site that has limited Oracle sessions.

Thanks for any help!

Last edited by Jammer1982 (2007-03-30 09:26:34)

Re: Rails' connection to database

I think this link captures my problem exactly: http://www.mail-archive.com/rubyonrails … 01085.html

I would think this is more of a widespread problem. Anyone else seeing this issue? with Oracle specifically...