yes, it is a DataObject issue. and there you have a pool of
connections. once a minute there a scavenger thread cleaning up the
pool, i.e. closing all idle connections. well, that is the current
implementation. so with your situation it should be fine to work.
maybe you should set the pool size to 1 by adding this in startup of
your software:

DataObjects::Mysql::Connection.class_eval do
   def self.pool_size
     1
   end
end

if this is really not enough it is possible to flush! the pool but it
should do without the flush!.

with regards
Kristian

On Jul 21, 6:27 am, Jordan Ritter <j...@darkridge.com> wrote:
> Sounds like this is more a DataObjects question than a DataMapper question.  
> Still, have you thought about mysqlproxy (or something similar) as an 
> intermediate connect / load-balancing point?  Haven't ever explored using it 
> that way, but generally speaking any proxy that has a mysql-specific notion 
> of connection state could multiplex down to a smaller number of connections..
>
> cheers,
> --jordan
>
> On Jul 20, 2010, at 11:22 AM, Jonathan Badger wrote:
>
> > I am writing a bioinformatics tool that uses a database (MySQL)  to
> > store and fetch data as needed. This tool is generally run on a
> > distributed system with over a thousand nodes, all or some of which
> > may be used by my tool depending on who else is using the system. The
> > problem is that we are not allowed more than 50 concurrent connections
> > to the MySQL server. So each instance of the tool can't keep a
> > connection to itself. I have dealt with this in the current version of
> > my tool which uses the MySQL bindings directly by opening a connection
> > (waiting if no free connections are available), talking to the
> > database, and then closing the connection, freeing it for other
> > instances running on other nodes. Since the majority of the time each
> > instance doesn't need to talk to the database and is instead
> > performing analysis on the retrieved data, 50 connections is plenty
> > for even thousands of simultaneous instances.
>
> > Now I would like to use Datamapper rather than raw SQL. Is such
> > managing of connections possible in Datamapper?
>
> > Jonathan

-- 
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to datamap...@googlegroups.com.
To unsubscribe from this group, send email to 
datamapper+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en.

Reply via email to