On Thursday, May 31, 2012 7:10:04 AM UTC-5, Mario Ruiz wrote:
>
> I'm running sequel on sinatra, and I have a method to get the content from 
> database:
>   def getContent(sql)
>     require 'sequel'
>     dsn={
>       :adapter=>"oracle",
>       :database=>"mydb",
>       :user=>"myuser",
>       :password=>"mypassword"
>     }
>     connection = Sequel.connect(dsn)
>     res=connection.fetch(sql)
> connection.disconnect
> Sequel::DATABASES.delete(connection) 
>     return res
>   end
>
>
> but it seems that the connections are not terminated so I reach at the end 
> the limit of connections in my db
>
> Any idea how to solve this?
>

Is there a reason for creating a new connection on every request? Why not 
connect once and let Sequel's connection pool handle it. 

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sequel-talk/-/cpQ6jE9j_v4J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to