# Independent SQL connections...race condition?

**URL:** <https://www.ruby-forum.com/t/independent-sql-connections-race-condition/52294>\
**Category:** Rails\
**Created:** [January 12, 2006, 4:48pm UTC](https://www.ruby-forum.com/t/independent-sql-connections-race-condition/52294 "2006-01-12T16:48:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yankees26](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/eb9ed0/32.png) [@yankees26](https://www.ruby-forum.com/u/yankees26)\
**Post date:** [January 12, 2006, 4:48pm UTC](https://www.ruby-forum.com/t/independent-sql-connections-race-condition/52294/1 "2006-01-12T16:48:08Z")

</div>

I would like to be able to manage different db connections per request.  
I’ve  
gotten this working by using establish\_connection in a before\_filter on  
all  
controllers. My concern is whether or not there could be a race  
condition  
where two or more overlapping requests might reset the SQL connection.  
Is  
there any serialization logic which will prevent this? Must I introduce  
this  
logic manually?

Thanks for any help.

James
