# Is every request one thread?

**URL:** <https://www.ruby-forum.com/t/is-every-request-one-thread/185778>\
**Category:** Rails\
**Created:** [March 25, 2010, 11:33pm UTC](https://www.ruby-forum.com/t/is-every-request-one-thread/185778 "2010-03-25T23:33:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![S\_simon\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b487fb/32.png) [@S\_simon\_S](https://www.ruby-forum.com/u/S_simon_S)\
**Post date:** [March 25, 2010, 11:33pm UTC](https://www.ruby-forum.com/t/is-every-request-one-thread/185778/1 "2010-03-25T23:33:02Z")

</div>

I am asking because the documentation in ConnectionPool states that

“The basic idea is that each thread checks out a database connection  
from the pool, uses that connection, and checks the connection back  
in.”

I would like to check out a connection in a before\_filter, and check it  
back in in an after\_filter of a request, because I need to be sure to  
use the same connection for the whole lifecycle of the request (I need  
to set a session variable that is read by some views that use it as  
prameter).

Can someone who knows confirm?

Thanks!
