# Oracle snipes my idle connections

**URL:** <https://www.ruby-forum.com/t/oracle-snipes-my-idle-connections/138142>\
**Category:** Rails\
**Created:** [May 20, 2008, 4:12pm UTC](https://www.ruby-forum.com/t/oracle-snipes-my-idle-connections/138142 "2008-05-20T16:12:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmorin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f0a364/32.png) [@dmorin](https://www.ruby-forum.com/u/dmorin)\
**Post date:** [May 20, 2008, 4:12pm UTC](https://www.ruby-forum.com/t/oracle-snipes-my-idle-connections/138142/1 "2008-05-20T16:12:19Z")

</div>

I’ve got a very low traffic site running against Oracle. The monitors  
show my ruby processes holding their database connections for the  
maximum time configured, at which time they are “sniped”. I am relying  
on Rails to properly reconnect when necessary - I haven’t seen any  
errors indicating that it is _not_ doing that.

I’ve been asked if Rails can be configured to do its own idle connection  
management, closing them after a given period of time and then only  
reconnecting when necessary.

I have no idea. Can somebody help me out? It’s a small app and a small  
number of connections, I think the ops guys just want to clean up their  
monitoring report. But, still, it’d be good information to know.  
Thanks!

---

<div class="post-metadata">

**Author:** ![dmorin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f0a364/32.png) [@dmorin](https://www.ruby-forum.com/u/dmorin)\
**Post date:** [May 20, 2008, 4:23pm UTC](https://www.ruby-forum.com/t/oracle-snipes-my-idle-connections/138142/2 "2008-05-20T16:23:13Z")

</div>

On 20 May 2008, at 15:12, Duane M. wrote:

> management, closing them after a given period of time and then only  
> reconnecting when necessary.
> 
> I have no idea. Can somebody help me out? It’s a small app and a  
> small  
> number of connections, I think the ops guys just want to clean up  
> their  
> monitoring report. But, still, it’d be good information to know.  
> Thanks!

There’s nothing I know about that can get Rails to close connections.  
Perhaps your best bet would be to get the database to time out your  
connections relatively quickly. As long as your ActiveRecord  
verification\_timeout is lower you shouldn’t see any ill effects and  
you won’t have connections hanging around for as long.

Fred

---

<div class="post-metadata">

**Author:** ![dmorin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f0a364/32.png) [@dmorin](https://www.ruby-forum.com/u/dmorin)\
**Post date:** [May 21, 2008, 2:54am UTC](https://www.ruby-forum.com/t/oracle-snipes-my-idle-connections/138142/3 "2008-05-21T02:54:34Z")

</div>

Here’s probably more than you ever wanted to know of the subject.

If you are lazy check the status of the ticket (wontfix) and then skip  
to the end of the comments. Then if still interested further click the  
link in the last comment and see why sharing connections in pools in  
Rails is not such a great idea.

At least that seems to be the case for now.

Here is another article on [oracle.com](http://oracle.com) that I found interesting. It  
doesn’t really cover the connections issues, but still have some  
interesting stuff in there:  
[http://www.oracle.com/technology/pub/articles/fernandez-rails-connections.html](http://www.oracle.com/technology/pub/articles/fernandez-rails-connections.html)

On May 20, 10:22 am, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![dmorin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f0a364/32.png) [@dmorin](https://www.ruby-forum.com/u/dmorin)\
**Post date:** [May 21, 2008, 7:47am UTC](https://www.ruby-forum.com/t/oracle-snipes-my-idle-connections/138142/4 "2008-05-21T07:47:18Z")

</div>

On Tue, May 20, 2008 at 5:53 PM, Robert W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> If you are lazy check the status of the ticket (wontfix) and

? what “ticket”?

–  
Hassan S. ------------------------ removed\_email\_address@domain.invalid
